Created
August 10, 2022 12:03
-
-
Save blacksmithop/40e7dbb757948372f232421aed5b8790 to your computer and use it in GitHub Desktop.
Iteration using walrus operator
This file contains hidden or 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
| 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