0
if statement : what is wrong with code
Check this out!! If, elif & else conditions. price = 60 if price > 100: print("price is greater than 100") elif price == 100: print("price is 100") else price < 100: print("price is less than 100")
2 Answers
+ 7
Nothing should come after âelseâ.
Instead of writing âelse price < 100â, just write âelseâ.
Like this:
price = 60
if price > 100:
print("price is greater than 100")
elif price == 100:
print("price is 100")
else:
print("price is less than 100")
+ 3
thank you very much