Search
 
SCRIPT & CODE EXAMPLE
 

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
'''
Comment

PREVIOUS NEXT
Code Example
Python :: pandas plot several columns 
Python :: flask api abort 
Python :: float to string python 
Python :: create dictionary from keys and values python 
Python :: summary in python 
Python :: python request response json format 
Python :: pytorch optimizer change learning rate 
Python :: decision tree algorithm python 
Python :: flask autherror 
Python :: django reverse queryset 
Python :: python data structures 9.4 
Python :: drop every other column pandas 
Python :: find max length in string in pandas dataframe 
Python :: How to perform Bubble sort in Python? 
Python :: making a basic network scanner using python 
Python :: python for k, v in dictionary 
Python :: Action based permissions in Django Rest V3+ 
Python :: esp8266 micropython ds18b20 
Python :: python convert string to bytes 
Python :: pandas take first n rows 
Python :: convert list to nd array 
Python :: how to file in python 
Python :: how to change python version 
Python :: python fillna with mean in a dataframe 
Python :: call a function onclick tkinter 
Python :: ordereddict 
Python :: seaborn correlation heatmap 
Python :: move column in pandas 
Python :: flask template split string 
Python :: dict typing python 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =