# Python Dollar Change Calculator not giving correct amounts

I am writing a program for my Python class homework. I have a good baseline, however, it's been 3 days and now this problem is just actually a problem and I am stuck.

My professor wants the change to be given with no cents, and to start giving change based on the largest possible dollar bill. No if statements can be used, and it can supposedly be done with just mathematical operators.

I tried searching for help, but everyone is using if statements and I am not sure if this is a math issue or a program issue! The main thing that happens is the 50 dollar bill and 20 dollar bill seem to be giving correct change but then at the 10, 5, and 1 dollar bill it stops working.

I deleted the parts for the 5 and 1 dollar bill but I did try them. The professor also wants it printed out in an f string.

``````def main():
cost = int(input('Enter the dollar amount of the item(no cents): '))
h_bill = int(100)
dollars_left = h_bill - cost
fifty_change = (dollars_left // 50)
fifty_left = dollars_left % 50
twenty_change = (fifty_left // 20)
twenty_left = dollars_left % 20
ten_change = (twenty_left // 10)
ten_left = dollars_left % 10