KnowledgeBoat Logo

Computer Science

State True or False:

"In a Python program, if a break statement is given in a nested loop, it terminates the execution of all loops in one go."

Python Control Flow

19 Likes

Answer

False

Reason — In a Python program, if a break statement is given in a nested loop, it only terminates the execution of the innermost loop where the break statement is encountered. It does not affect the outer loops or any remaining loops in the nested structure.

Answered By

14 Likes


Related Questions