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

2

how to separate a string or int with comma in python

string = input('Input')
    >>> 1,2
    print(cord.split(','))
    >>>['1', '2']
Posted by: Guest on March-31-2020
1

how to split an input in python by comma

lst = input().split(',')#can use any seperator value inside '' of split
print (lst)
#given input = hello,world
#output: ['hello', 'world']
#another example 
lst = input().split(' ; ')#can use any seperator value inside '' of split
print (lst)
#given input = hello ; world ; hi there
#output: ['hello', 'world', 'hi there']
Posted by: Guest on July-06-2020
0

convert list to string separated by comma python

converted_list = [str(element) for element in a_list]
Posted by: Guest on October-04-2020

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

Python Answers by Framework

Browse Popular Code Answers by Language