Abschnitt 2. Kapitel 5
single
Else
Swipe um das Menü anzuzeigen
else can be used not only inside if-else statements but after loops. Instructions after else statement are executing after exiting the loop but not because of break. If you leave the loop because of break, else instructions are skipped.
1234while condition: inctructions... else: instructions...
Aufgabe
Wischen, um mit dem Codieren zu beginnen
For the given list list_, check if all elements in it are positive. Print YES or NO. Use break to leave the loop if a non-positive number appears.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 5
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen