Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Else | While Loops: Essentials
Python Loops

bookElse

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.

1234
while condition: inctructions... else: instructions...
copy
Aufgabe

Swipe to start coding

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?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 5
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

Zusammenfassen Sie dieses Kapitel

Code in file erklären

Erklären, warum file die Aufgabe nicht löst

close

Awesome!

Completion rate improved to 6.25

bookElse

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.

1234
while condition: inctructions... else: instructions...
copy
Aufgabe

Swipe to start coding

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

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

close

Awesome!

Completion rate improved to 6.25
Abschnitt 2. Kapitel 5
single

single

some-alt