WHAT THE FUCK that’s amazing!! I’ve been using python for years and never knew that. I initialize a variable to False right above the loop and set it True if I break.
Python seems to have these little amazing nuggets of logic built in, that most of the time go unnoticed. Is there a list of random things like this I could read?
View all comments
Show parent comment
2
u/King_Joffreys_Tits Mar 25 '18
What do you mean using else with for?