facing the issue for remove the value from list (when value is repeated)
Dec. 21, 2021
5:12 p.m.
Good evening everyone I used python 3.7.3 IDLE i found the bug to solve the problem when list contain repetitive value is come i.e. if i want to delete 2 from list using remove function it's 2 value put containouls 2 and such value is remove using any type of loop all element are not delete from list. Any higher version cover such type of problem? or any other method for delete such value list1=[1,2,3,2,4,2,7,2,2,2,2,5,5,5,2,4,5,6,7,8] a=0 while a < len(list1): if list1[a]==2: list1.remove(2) a=a+1 print(list1)
December 2021
8:42 p.m.
Hello! The python-dev list is for developing the next version of Python. For help using Python, please send your question to python-list@python.org Thanks, and good luck! -- ~Ethan~
1579
Age (days ago)
1579
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ethan Furman -
laxmikant5656@gmail.com