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

निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

What will be the output of the following Python code?

if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("good")
else:
    print("bad")

A)
B)
C)
D)

Explanation:

Sure! Let's break it down:

  1. First condition: (9 < 0) and (0 < -9)

    • 9 < 0 is False.
    • 0 < -9 is also False.
    • So, the entire condition is False.
  2. Second condition: (9 > 0) or False

    • 9 > 0 is True.
    • False is False.
    • But since it's an or condition, if either part is true, the result is True.
  3. Since the second condition is True, the output will be "good", and it skips the else part.

Answer: (C) good.

Latest Updates