Skip to content

Instantly share code, notes, and snippets.

@adamoudad
Created October 16, 2022 19:05
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 adamoudad/1adffff9b85601d1de444ebe1b78e24d to your computer and use it in GitHub Desktop.
Save adamoudad/1adffff9b85601d1de444ebe1b78e24d to your computer and use it in GitHub Desktop.
for i in range(n):
try:
data = next(dataiter)
except ValueError:
continue
# The code here is ignored if ValueError is raised in the "try" block
# Otherwise, run the rest of the loop here ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment