Pretty sure my problem has nothing to do with the floats, I don't see why a float would affect total > 0. I'm just trying to make a simple program for beginners for my computer programming class. I am looking for why inputting certain numbers for the coins doesn't output the twenties tens fives etc... one that does work is 50 for all inputs haven't found another one that does work there is no error message, it just doesn't print the output twenties, tens, fives etc.. Maybe I'm just excruciating tired but I just can't seem to find what's wrong with my program. Any help would be appreciated.
quarters = int(input("Enter a number of quarters: "))
dimes = int(input("Enter a number of dimes: "))
nickels = int(input("Enter a number of nickels: "))
pennies = int(input("Enter a number of pennies: "))
total = (quarters * .25) + (dimes * .1) + (nickels * .05) + (pennies * .01)
print("The total value of all coins is: " + str(total))
quarters = 0
nickels = 0
pennies = 0
dimes = 0
twenties = 0
tens = 0
fives = 0
ones = 0
while total > 0:
while total >= 20:
total = total - 20
twenties = twenties + 1
while total >= 10:
total = total - 10
tens = tens + 1
while total >= 5:
total = total - 5
fives = fives + 1
while total >= 1:
total = total - 1
ones = ones + 1
while total >= .25:
total = total - .25
quarters = quarters + 1
while total >= .1:
total = total - .1
dimes = dimes + 1
while total >= .05:
total = total - .05
nickels = nickels + 1
while total >= .01:
total = total - .01
pennies = pennies + 1
print("\nTwenties: " + str(twenties))
print("Tens: " + str(tens))
print("fives: " + str(fives))
print("ones: " + str(ones))
print("quarters: " + str(quarters))
print("dimes: " + str(dimes))
print("nickels: " + str(nickels))
print("pennies: " + str(pennies))
input("\nPress enter to quit")