Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Write formula into the cycle-function
- def monthly_payment(t, s, n, k):
- p = (s / n) + (s - (t - 1) * (s / n)) * (k / (12 * 100))
- return p
- # Automatic ask input data
- s = float(input()) # credit amount
- n = int(input()) # credit term in month
- k = float(input()) # percent per year
- # Create every month list
- month_list = [((n-1)+1) for t in range(0, n)]
- t = month_list
- pay_list = [monthly_payment(t, s, n, k) for i in month_list]
- # Print the result
- print("%2d месяц - %8.2f руб" % (month_list, pay_list))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement