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

निम्नलिखित कोड खंड क्या प्रिंट करेगा?

What will following code segment print ?

if True or True:
      if False and True or False:
             print(‘A’)
      elif False and False or True and True:
             print(‘B’)
      else:
             print(‘C’)
      else:
             print(‘D’)
A)
B)
C)
D)

Explanation:

Sure!

  • True or True is True, so the first block is executed.
  • The second condition False and True or False is False, so it moves to elif.
  • False and False or True and True is True, so it prints 'B'.

Answer: (B) B.

Latest Updates