+ 2
(SOLVED)Why doesn't my final line work?
cominput = input("give sale amount in whole dollars") if cominput <= "5000": print("0.05) elif cominput > "5000" != "10000": print("0.1") else: print("0.15") (Note: i have also tried replacing the final line with elif cominput >= 10000 and that didn't work either)
12 Respuestas
+ 5
Eric Check out this code.
https://code.sololearn.com/c07yooDN78F0/?ref=app
+ 4
Because in the first condition you forgot to add a "
+ 2
Yeah ⚡🔥 😎 Baby Hater 🔥⚡ is right and also I think that final line youre talking about should be like this
elif cominput > "5000" and cominput < "10000":
+ 1
Ohh actually I noticed something wrong
Its better if you convert the input first to INTEGER then Compare it to another integer.
+ 1
thanks nicko!
+ 1
Yeah and ⚡🔥 😎 Baby Hater 🔥⚡ too
0
What do you mean?
0
if you are referring to the 10000 in the alternative, it was there when i tried i just forgot to type that part out when typing my question
0
Eric In the print time of the first condition
0
let me just type in exactly what i have right now
cominput = input("give sale amount in whole dollars ")
if cominput <= "5000":
print("0.05")
elif cominput > "5000" and cominput < "10000":
print("0.1")
elif cominput >= "10000":
print("0.15")
0
How would I do that?
0
You do realise your comparing string...eg
print("6000" < "50000000") this output false.