Computer Science, asked by cat12345, 9 months ago

What is the output of the following snippet?
T=1
while T:
print(True)
break​

Answers

Answered by poojan
2

Answer:

True

Explanation:

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

Attachments:
Similar questions