Advertisement
nikolask

Untitled

Aug 5th, 2023
1,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | Source Code | 0 0
  1. def main():
  2.     amount_due = 50
  3.     while amount_due > 0:
  4.         print("Amount Due: ", amount_due)
  5.         amount_due -= check_coins()
  6.     print("Change Owed: ", abs(amount_due))
  7.  
  8. def check_coins():
  9.     while True:
  10.         coins = int(input("Insert Coin: "))
  11.         if coins  == 25 or coins == 10 or coins == 5:
  12.             break
  13.     return coins
  14.  
  15. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement