Skip to content

Instantly share code, notes, and snippets.

@blacksmithop
Created August 10, 2022 12:03
Show Gist options
  • Select an option

  • Save blacksmithop/40e7dbb757948372f232421aed5b8790 to your computer and use it in GitHub Desktop.

Select an option

Save blacksmithop/40e7dbb757948372f232421aed5b8790 to your computer and use it in GitHub Desktop.
Iteration using walrus operator
items = list(range(1,11))
i_items = iter(items)
while el := next(i_items):
print(el)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment