📜  如何用逗号分割python中的输入 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:51.318000             🧑  作者: Mango

代码示例3
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']