Advertisement
MichalDK

Remove item

Apr 29th, 2022
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. # Když už tímto způsobem, tak je lepší použít while cyklus
  2. my_list = [1, 0, 0, 1, 1, 0, 1, 3, 1, 4, 5, 6, 1, 1, 1, 1, 1]
  3. print(my_list)
  4. removed_value = 1
  5. while removed_value in my_list:
  6.     my_list.remove(removed_value)
  7. print(my_list)
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement