Answers for "how to convert list to comma separated string in python"

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

list from comma separated string python

>>> my_string = 'A,B,C,D,E'
>>> my_list = my_string.split(",")
>>> print my_list
['A', 'B', 'C', 'D', 'E']
Posted by: Guest on February-13-2021

Code answers related to "how to convert list to comma separated string in python"

Python Answers by Framework

Browse Popular Code Answers by Language