InterviewSolution
Saved Bookmarks
| 1. |
What is the output of the following snippet?T=1while T:print(True)break |
|
Answer» TrueExplanation:Observe the snap attached below.As T is initialized with 1,while STATEMENTS take every integer as True expect 0.So "while T:" as in "while 1:" becomes true and enters the loop and PRINTS True.As, the IMMEDIATE statement is break, after printing True, the termination of loop happens.So, the output is True |
|