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.
D error For More Reference =>>
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...
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
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.
United States 趋势
- 1. Jets 119K posts
- 2. Courtois 45.2K posts
- 3. Sauce 83.3K posts
- 4. Colts 57K posts
- 5. Breece Hall 11.1K posts
- 6. Liverpool 229K posts
- 7. $JFB N/A
- 8. Quinnen Williams 26.3K posts
- 9. Garrett Wilson 5,266 posts
- 10. Cheney 241K posts
- 11. Real Madrid 187K posts
- 12. Beane 5,493 posts
- 13. Luis Diaz 33.8K posts
- 14. Veach 5,902 posts
- 15. Penning 3,274 posts
- 16. Shaheed 17.7K posts
- 17. Hakimi 32.8K posts
- 18. Brad Holmes 1,263 posts
- 19. Bayern 117K posts
- 20. AD Mitchell 6,763 posts
Something went wrong.
Something went wrong.