split a variable into multiple variables in python

Solutions on MaxInterview for split a variable into multiple variables in python by the best coders in the world

showing results for - "split a variable into multiple variables in python"
Joséphine
17 Jan 2021
1variable = "Hello, my name, is, ect"
2
3#The seperate varibles ("a,b,c,d")     
4a, b, c, d = variable.split(",") # What we are splitting the variable with (",") 
5
6print(f"{a} \n {b} \n{c} \n{d}")
7# Our output would be:
8'''
9Hello
10my name
11is
12ect
13'''