Answers for "python split comma separated string to list"

3

python list comma separated string

hobbies = ["basketball", "football", "swimming"]
print("My hobbies are:")      	# My hobbies are:
print(", ".join(hobbies)) 		# basketball, football, swimming
Posted by: Guest on February-16-2021
0

split a string by comma in python

str = 'apple,orange,grape'

#split string by ,
chunks = str.split(',')

print(chunks)
Posted by: Guest on May-12-2021

Code answers related to "python split comma separated string to list"

Python Answers by Framework

Browse Popular Code Answers by Language