+ 5

Is there function deleting data from list?

Is there function like a alternative append(), deleting data from list. I doesn't mean set this to 0.

4th Aug 2018, 7:35 PM
Sebastian
Sebastian - avatar
7 ответов
+ 7
list.remove(value) or del list[index]
4th Aug 2018, 9:17 PM
TheNewHEROBRINE
TheNewHEROBRINE - avatar
+ 4
You have also list.pop(index)
4th Aug 2018, 10:46 PM
Comsis Alexis
Comsis Alexis - avatar
+ 2
list.remove(value) or list.pop() - it will delete last element of the list.
6th Aug 2018, 3:28 AM
Rahul Singh
Rahul Singh - avatar
+ 1
Thanks you guys!
5th Aug 2018, 9:01 AM
Sebastian
Sebastian - avatar
0
how to undo
6th Aug 2018, 8:19 AM
r M
r M - avatar
0
?
6th Aug 2018, 8:20 AM
r M
r M - avatar
0
Undo what? (you mean recall the element that has been deleted?)
7th Aug 2018, 8:43 AM
Comsis Alexis
Comsis Alexis - avatar