निम्नलिखित कोड खंड क्या प्रिंट करेगा?
What will following code segment print ?
a = True
b = False
c = False
if not a or b:
print(1)
elif not a or not b and c:
print (2)
elif not a or b or not b and a:
print (3)
else:
print (4) A
1
B
3
C
2
D
4
Explanation
Sure!
- First condition
not a or b:False or False→ False - Second condition
not a or not b and c:False or (True and False)→ False - Third condition
not a or b or not b and a:False or False or True→ True
So, it prints 3.
Answer: (B) 3.
Correct Answer: B) 3