Skip to content

Instantly share code, notes, and snippets.

@flutesa
Created April 7, 2020 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flutesa/64b47c9ce72eb6cbc05d1e36964a12c3 to your computer and use it in GitHub Desktop.
Save flutesa/64b47c9ce72eb6cbc05d1e36964a12c3 to your computer and use it in GitHub Desktop.
remove from array
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