Answers for "delete list"

4

pytho. how to remove from a list

names = ['Boris', 'Steve', 'Phil', 'Archie']
names.pop(0) #removes Boris
names.remove('Steve') #removes Steve
Posted by: Guest on October-19-2020
0

delete item from list

listname.remove(element)
Posted by: Guest on October-09-2020
0

del method in python lists

l = ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']
print(l)
# ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']

l.remove('Alice')
print(l)
# ['Bob', 'Charlie', 'Bob', 'Dave']
Posted by: Guest on April-05-2021
0

del(list) python

del[a:b] #This will delete everything from range A to B
Posted by: Guest on April-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language