Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. def bank():
  2. balance = float(input("Input credit card balance: "))
  3. apr_interest = float(input("Input APR on the card: "))
  4. print("Assuming a minimum payment of 2% of balance ($20 min) Your minimum payment would be 20.00")
  5. mon_selection = input('Use minimum monthly payment?: ')
  6. while mon_selection != 'n' and mon_selection != 'y':
  7. mon_selection = input('Enter selection: ')
  8. mon_repay = 0
  9. if mon_selection == 'n':
  10. mon_repay = int(input('Enter monthly repay ammount: '))
  11. if mon_selection == 'y':
  12. mon_repay = 20
  13. num = 0
  14. interest = 0
  15. interest1 = 0
  16. final = 0
  17. while (balance >= mon_repay):
  18. interest = (balance * apr_interest)/1200
  19. balance = (balance - mon_repay) + interest
  20. interest1 = interest1 + interest
  21. num = num + 1
  22. print('Balance ','Interest paid ', 'Payment number ')
  23. print('{:>7}'.format(round(balance, 2)),('{:>17}'.format(round(interest, 2))),('{:>25}'.format(num)))
  24. bank()
  25. recalc = input("Recalculate with different year?")
  26. while recalc != 'n' and recalc != 'y':
  27. recalc = input("Recalculate with different year?")
  28. if recalc == 'y':
  29. bank()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement