🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

आइए निम्नलिखित पायथन कोड पर विचार करें, इस कोड का आउटपुट है

Let consider the following Python code. The output of this code is ____

a = True
b = False 
c = False 
if a or b and c:
    print("TRUE")
else:
    print("FALSE") 
A)
B)
C)
D)

Explanation:

Let's analyze the given Python code:

a = True
b = False
c = False
if a or b and c:
    print("TRUE")
else:
    print("FALSE")

Step-by-Step Explanation:

  1. Variables:

    • a = True
    • b = False
    • c = False
  2. Condition in the if statement:

    • The expression a or b and c involves both the logical or and and operators.
    • Operator Precedence: In Python, and has higher precedence than or. So, b and c is evaluated first.
  3. Evaluate b and c:

    • b and c evaluates as False and False, which is False.
  4. Evaluate a or (b and c):

    • Now the condition becomes a or False, which is True or False, which is True.
  5. Result:

    • Since the condition evaluates to True, the code inside the if block is executed, so "TRUE" is printed.

Answer:

(A) TRUE

Latest Updates