Answers for "how to return list as string separated by comma in a claee 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 return list as string separated by comma in a claee python"

Python Answers by Framework

Browse Popular Code Answers by Language