That is some of the most cursed python I've ever seen. It works because under the hood a for loop is essentially an if with a goto to the start of the loop and you can then just add an else onto that, but it just feels wrong.
Your explanation took less time than I took to finish. :). - The enumerate has this this interesting quality where you can start at any number you want. enumerate(iter, 1) would start at 1 to avoid the offset.
@@hyper-neutrino Thank you for your answer. I set up code to use Monaspace Radon for some languages and document types (py, md, adoc) for which I prefer the handwritten style now that I have discovered this font. So far I really like it. I still use Dank Mono for anything else because of the nice italics.
Yeah, the grouping is actually not needed and you can just replace ; with , and then process it all at once. I only noticed this afterwards; perhaps I will revisit it someday.
You just blew my mind with the else block on the for loop! Had no idea this was a thing!
That is some of the most cursed python I've ever seen. It works because under the hood a for loop is essentially an if with a goto to the start of the loop and you can then just add an else onto that, but it just feels wrong.
Your explanation took less time than I took to finish. :).
- The enumerate has this this interesting quality where you can start at any number you want. enumerate(iter, 1) would start at 1 to avoid the offset.
Oh, wait what? That's really cool, TIL. Thanks for the great tip!
Hey thanks for solving those with commentary! Helps a ton someone whos starting out
What color theme and font are you using? It looks really cool!
The color theme is GitHub Dark, the font is Monaspace Radon, and as an added bonus, the icon theme is material-icon-theme
@@hyper-neutrino Thank you !
It was a good hunt. You can "else" a "for" loop? Nice trick...
Yeah, you can do it on a while loop too (same idea)
Thanks for the video! Could you tell me the name of the font you are using in code?
I'm using Monaspace Radon from GitHub Next. It's a bit unusual but I really like it; let me know what you think about it!
@@hyper-neutrino Thank you for your answer. I set up code to use Monaspace Radon for some languages and document types (py, md, adoc) for which I prefer the handwritten style now that I have discovered this font. So far I really like it. I still use Dank Mono for anything else because of the nice italics.
I agree that Day 2 was easier than Day 1, at least for me.
My solution was monstrous, Am ashamed of it, but it works😅
I combined all the sets cause they were irrelevant. Don't really see the use of the sets maybe I'm wrong.
Yeah, the grouping is actually not needed and you can just replace ; with , and then process it all at once. I only noticed this afterwards; perhaps I will revisit it someday.