Advertisement
Vitaliy_Novichikhin

2.3.4 error

Aug 15th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. # Write formula into the cycle-function
  2. def monthly_payment(t, s, n, k):
  3.     p = (s / n) + (s - (t - 1) * (s / n)) * (k / (12 * 100))
  4.  
  5.     return p
  6. # Automatic ask input data
  7. s = float(input()) # credit amount
  8. n = int(input()) # credit term in month
  9. k = float(input()) # percent per year
  10.  
  11. # Create every month list
  12. month_list = [((n-1)+1) for t in range(0, n)]
  13. t = month_list
  14. pay_list = [monthly_payment(t, s, n, k) for i in month_list]
  15.  
  16. # Print the result
  17. print("%2d месяц - %8.2f руб" % (month_list, pay_list))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement