Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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']
Comment

PREVIOUS NEXT
Code Example
Python :: brownie to wei 
Python :: pyttsx3 pip 
Python :: How to find least common multiple of two numbers in Python 
Python :: django settings variables 
Python :: django raise 404 
Python :: how to pass header in requests 
Python :: nltk stop words 
Python :: numpy test code 
Python :: dataframe to txt 
Python :: draw bounding box on image python cv2 
Python :: href in selenium 
Python :: django settings module LOGIN_URL 
Python :: python month number from date 
Python :: beautiful soup 4 python 
Python :: python print list with newline 
Python :: pandas read_csv random rows 
Python :: pandas index to list 
Python :: python repeating scheduler 
Python :: how to unzip files using zipfile module python 
Python :: pandas read csv without header 
Python :: install python decouple 
Python :: matplotlib latex non italic indices 
Python :: get eth balance python 
Python :: convert int to byte python 
Python :: password manager python with min and max pass lenght 
Python :: opencv flip image 
Python :: check palindrome in python using recursion 
Python :: how to open cmd at specific location usng python 
Python :: print on two digit python format 
Python :: python blackjack 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =