Created
April 7, 2020 15:41
-
-
Save flutesa/64b47c9ce72eb6cbc05d1e36964a12c3 to your computer and use it in GitHub Desktop.
remove from array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = [random.randrange(-100, 200) for x in range(10)] | |
print(array) | |
for a in array.copy(): | |
if a < 0: | |
array.remove(a) | |
print(array) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment