Else
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...
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.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 6.25
Else
Desliza para mostrar el menú
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...
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.
Solución
¡Gracias por tus comentarios!
Awesome!
Completion rate improved to 6.25single