निम्नलिखित कोड खंड क्या प्रिंट करेगा?
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
A
B
B
C
C
D
D
Explanation
Sure!
True or TrueisTrue, so the first block is executed.- The second condition
False and True or FalseisFalse, so it moves toelif. False and False or True and TrueisTrue, so it prints'B'.
Answer: (B) B.
Correct Answer: B) B