Advertisement
ssoni

coke.py

Jan 3rd, 2024
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def main():
  2. amtDue = 50
  3. validCoins = [5,10,25]
  4. while (amtDue>0):
  5. print(f'Amount Due: {amtDue}')
  6. coin = int(input('Insert Coin: '))
  7. if coin not in validCoins:
  8. continue
  9. else:
  10. amtDue = amtDue - coin
  11. changeOwed = -amtDue
  12. print(f'Change Owed: {changeOwed}')
  13.  
  14. main()
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement