These MCQs are for the Boolean logic section of lesson Making Choices.
What will to following code segment print?
if (10 < 0) and (0 < -10):
print("A")
elif (10 > 0) or False:
print("B")
else:
print("C")
A
B
C
B
and C
What will to 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
B
and D
or
returns as soon
as one side is false.or
with "exclusive" or.else
is not evaluated if the if
Boolean is True.