Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split a variable into multiple variables in python

variable = "Hello, my name, is, ect"

#The seperate varibles ("a,b,c,d")     
a, b, c, d = variable.split(",") # What we are splitting the variable with (",") 

print(f"{a} 
 {b} 
{c} 
{d}")
# Our output would be:
'''
Hello
my name
is
ect
'''
 
PREVIOUS NEXT
Tagged: #split #variable #multiple #variables #python
ADD COMMENT
Topic
Name
4+4 =