mardi 14 juin 2016

I require assistance in understanding what's wrong with my code (if statements)

I'm not sure what I did wrong in this code, but for some reason, Eclipse keeps on telling me that the if statement is just bad. I'm not sure why, when I look at the examples, it looked fine to me.

penny = .01

nickel = .05

dime = .1

quarter = .25

print("Enter how many coins you want to use to make a dollar.")

e_pen = int(input("Enter the amount of pennies you want: "))

e_nic = int(input("Enter the amount of nickels you want: "))

e_dim = int(input("Enter the amount of dimes you want: "))

e_qua = int(input("Enter the amount of quarters you want: "))

doll = float((e_pen * penny) + (e_nic * nickel) + (e_dim *dime) + (e_qua * quarter))

if doll > 1

print("The total value is greater than 1 dollar.")

else

print("Try again.")

Aucun commentaire:

Enregistrer un commentaire