KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Predict the output of the following code:

flag = False
if flag:
    print("True")
else:
    print("False")

Python Control Flow

1 Like

Answer

Output
False
Explanation

The variable flag is assigned the value False. Since the condition in the if statement evaluates to False, the control moves to the else block, and "False" is printed as the output.

Answered By

2 Likes


Related Questions