16 is less than 25
Is there an error in this piece of code
Taiyan Paige
0
Reputation points
a = 16
b = 25
c = 27
if a > b:
if b > c:
print ("a is greater than b and b is greater than c")
else:
print ("a is greater than b and less than c")
elif a == b:
print ("a is equal to b")
else:
print ("a is less than b")
I believe there might be an error in the examples code. Can anyone inform me if I am correct or not.
it gave three variables to use as an example of how to write conditional code but it seems to be missing a condition. For example if A was greater than B and C but C is greater than B, wouldn't that make the first else statement incorrect. Wouldn't you have to add another condition considering a > c > b or even a = c > b
This question is related to the following Learning Module