Sololearn: Learn to Code
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 3
Hi,Rene ! It’s a part of Python’s syntax and is called “for-else” or “loop-else” (it works with while loops as well). It’s perfect in situations where you might have used flags previously. The else block is executed if the loop is not interrupted by a break statement.
13th Dec 2023, 10:43 PM
Per Bratthammar
Per Bratthammar - avatar