Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bank():
- balance = float(input("Input credit card balance: "))
- apr_interest = float(input("Input APR on the card: "))
- print("Assuming a minimum payment of 2% of balance ($20 min) Your minimum payment would be 20.00")
- mon_selection = input('Use minimum monthly payment?: ')
- while mon_selection != 'n' and mon_selection != 'y':
- mon_selection = input('Enter selection: ')
- mon_repay = 0
- if mon_selection == 'n':
- mon_repay = int(input('Enter monthly repay ammount: '))
- if mon_selection == 'y':
- mon_repay = 20
- num = 0
- interest = 0
- interest1 = 0
- final = 0
- while (balance >= mon_repay):
- interest = (balance * apr_interest)/1200
- balance = (balance - mon_repay) + interest
- interest1 = interest1 + interest
- num = num + 1
- print('Balance ','Interest paid ', 'Payment number ')
- print('{:>7}'.format(round(balance, 2)),('{:>17}'.format(round(interest, 2))),('{:>25}'.format(num)))
- bank()
- recalc = input("Recalculate with different year?")
- while recalc != 'n' and recalc != 'y':
- recalc = input("Recalculate with different year?")
- if recalc == 'y':
- bank()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement