“Como inserir valores de vírgula separados em python” Respostas de código

Valores separados por vírgula de entrada de python

lst = input().split(',')
Relieved Ray

Como dividir uma entrada em Python por vírgula

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']
Adhun Thalekkara

string a listar em vírgula Python

# input comma separated elements as string 
str = str (raw_input ("Enter comma separated integers: "))
print "Input string: ", str

# conver to the list
list = str.split (",")
print "list: ", list
Outrageous Oyster

Como inserir valores de vírgula separados em python

lst = list(map(int, input("Enter comma separated values: ").split(",")))
loobiish

Respostas semelhantes a “Como inserir valores de vírgula separados em python”

Perguntas semelhantes a “Como inserir valores de vírgula separados em python”

Mais respostas relacionadas para “Como inserir valores de vírgula separados em python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código