Comment your answers below!

Python_Dv's tweet image. Comment your answers below!

Answer: A) loop breaked The 99% trap: for...else! › When num==3, we print "loop breaked" and break › The else block runs only if loop completes without break › Since we broke early, else is skipped For beginners: else after loops means "if no break occurred"


Stream, call, game, and work in even the most remote locations. Order online in minutes


Error, indentation matters and 4-spaces are VERY important in this slow language.


Option A Loop breaked


Error...the else statement is not indented


D error: indentation


Error. Bad indentation


A) loop breaked When num == 3, it prints "loop breaked" and exits via break. The loop didn't finish normally, the for-else block isn't executed.


Start your journey in simulated trading with FTMO, backed by 10 years of experience.


Error because there is no "if" for that "else".. Indentation Matters alot in python...


loop breaked


The answer is A. There is no indentation error anywhere. The for else loop exists and works. It will execute the else case only if it run all the iterations without a breaking but since we got a 3 it will print loop breaked


Loop breaked


I thought it was D) Error because of the indentation


Lock and load, agents! Your favorite Spike-runners are ready to jump onto your walls. Prep your loadout for the new official VALORANT collection ➤


Answer is A. Loop breaked. Reason is because the moment the loop gets to 3, it breaks and print the string in the block.


In this case, when the loop reaches 3, it executes the print("loop breaked") and break, stopping the loop. The else block is not executed because the loop was terminated with break. Thus, the correct answer is: A) loop breaked.


I think it's error


For/else is correct Python code Answer is A.


Answer is A because the if condition was met


此推文不再可用。

A) loop breaked


A) Loop breaked


United States 趋势
Loading...

Something went wrong.


Something went wrong.