convert comma separated string to array of numbers python code example
Example 1: how to separate a string or int with comma in python
string = input('Input')
>>> 1,2
print(cord.split(','))
>>>['1', '2']
Example 2: python input comma separated values
lst = input().split(',')
Example 3: how to input comma separated int values in python
lst = list(map(int, input("Enter comma separated values: ").split(",")))
Example 4: convert list to string separated by comma python
converted_list = [str(element) for element in a_list]