Post

@Python_Dv Option A - loop breaked 😎
The else block runs only if the loop finishes normally (without hitting break).
English

C. None of these options cover what happens. There is a for loop that begins by checking if 1==3. Since this is False, “loop ended” is printed. The loop continues but since 2 does not equal 3, the loop continues with “loop ended”. When 3 is checked, the condition is True, “loop breaked” is printed and the loop breaks.
English

@Python_Dv A) loop breaked
Because after the if statement loop is stopped.
English

@Python_Dv The infamous for-else. Break kills the loop? Else dies with it. Output: 'loop breakeed' with the typo intact. Answer: A.
English

@Python_Dv Look at this👇 if you are unsure whether the else is attached to the if or the for loop.
x.com/PyBerryTech/st…
English

@Python_Dv A) loop breaked
The loop is broken because of "break" under the if statement.
English

@Python_Dv For num in nums artinya yg di dalam list akan di ulang.
Case,
Num 1 ga sama dengan 3.
Num 2 ga sama dengan 3.
Num 3 SAMA dengan 3 = true
Jika num = 3 lalu mencetak loop breaked
Dan terjadi break, maka proses loop terhenti.
Karena td ada BREAK maka else ga perlu. Jawaban A.
Indonesia

@Python_Dv @grok the right answer is A) loop breaked. Because the if clause verify the condition. Have i right ?
English















