dimanche 19 avril 2020

How can I use float nub and words in input at the same time?

cheese = float(input("Enter cheese order weight (numeric value): "))

if cheese >= 100: print(cheese,"is more than currently available stock ") elif cheese <= 0.15: print(cheese,"is below minimum order amount") elif cheese >= 0.16 <= 99: print(cheese," costs $",cheese * 7.99,sep = "") else: print(cheese,"Is invlide, please try agin")

Every time I add a letter I get an error. What I want to do is, I want to be able to add float nub and words, so I can use the else statement. Thanks




Aucun commentaire:

Enregistrer un commentaire