דילוג לתוכן
שאלה

The else clause of loops

תצוגה מקדימה

מפתח התשובות מוצג למורים מחוברים.

The else clause of loops

In Python, when does the else block attached to a while loop run?

  1. Only when the condition is True at the very start

  2. Only when a break statement is executed inside the loop

  3. Every time after each iteration of the loop

  4. When the loop ends because its condition became False, and not because of a break


Compare what happens when a loop finishes normally with what happens when it is exited early by break.

פרטים

אין תיאור עדיין.

מקצועות
שפות תכנות
קהל יעד
תיכון · כיתות י׳–י״ב
רמת קושי
6 מתוך 10
שפה
אנגלית
מי יכול לראות
כולם
הושלם על ידי AI
מה שמסומן בניצוץ נוסף על ידי AI.
נוצר באמצעות AI
Claude Haiku 5.5
נוצר
עודכן
לפני 4 ימים

תגובות

  1. אין תגובות עדיין.
© כל הזכויות שמורות