“Converta uma string em uma lista em Python” Respostas de código

converter string para listar python

# To split the string at every character use the list() function
word = 'abc'
L = list(word)
L
# Output:
# ['a', 'b', 'c']

# To split the string at a specific character use the split() function
word = 'a,b,c'
L = word.split(',')
L
# Output:
# ['a', 'b', 'c']
SkelliBoi

Converta uma string em uma lista em Python

def dpro(string):
    convertedlist = list(string.split(" "))
    return convertedlist
  
print(dpro("this will convert to List"))
Attractive Ape

Respostas semelhantes a “Converta uma string em uma lista em Python”

Perguntas semelhantes a “Converta uma string em uma lista em Python”

Mais respostas relacionadas para “Converta uma string em uma lista em Python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código