0
Hi guys, what`s wrong with this code? I get `No output`.
x = 55 if x > 56: print ('x > 56') if x < 56: print ('x <56') else: print ('x = 56')
3 Respostas
+ 4
You are identating wrong. The second if is inside your first if, so as the first condition is False, it never makes it to the second if
+ 1
because x is smaller than 56, so there is a break.
try this:
x = 55
if x > 56:
print ('x > 56')
elif x < 56:
print ('x <56')
else:
print ('x = 56')
0
Thank you guys, second if inside the first one, thats a mistake.