“Como limpar a lista em Python” Respostas de código

Como limpar uma lista em Python

yourlist = [1,2,3,4,5,6,7,8]
del yourlist[:]
Dr. Hippo

Como limpar a lista em Python

thislist = ["apple", "banana", "cherry"]
thislist.clear()
print(thislist)
Programmer of empires

Lista de Python Clear ()

# list of cars
cars = ['Benz',('volkswagen','BMW'),'Ford','Ferrari',('volkswagen','BMW')]
numbers= [1,(1,3),5,7,(1,3),3,1,6,(1,3)]

# clear the car list
cars.clear()
print("After clearing the car list = ",cars)

# clear the number list
numbers.clear()
print("After clearing the number list = ",numbers)
Gorgeous Gazelle

Respostas semelhantes a “Como limpar a lista em Python”

Perguntas semelhantes a “Como limpar a lista em Python”

Mais respostas relacionadas para “Como limpar a lista em Python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código