“Remova a string da lista em python” Respostas de código

Remova a string da lista em python

my_list = input("Enter your list splited by ',': ").split(',')
i = 0
while i < len(my_list):
    if my_list[i].isnumeric() == False:
        my_list.remove(my_list[i])
        i -= 1
    i += 1

print("List without str type: ",my_list)
Fawlid

Se uma lista tiver uma string removendo

strings_with_substring = [string for string in strings if substring in string]
Adventurous Albatross

Respostas semelhantes a “Remova a string da lista em python”

Perguntas semelhantes a “Remova a string da lista em python”

Mais respostas relacionadas para “Remova a string da lista em python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código