Vitaliy_Novichikhin

Stepik 2.1.10 fully wright

Jun 11th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def compute_income(deposit, interest_rate, amount_months):
  2.  
  3.     z = deposit * (1 + interest_rate / (12 * 100)) ** amount_months - deposit
  4.     return z
  5.  
  6. k = 8 # занести процент вклада
  7. n = 14# занести количество месяцев
  8. s = 938# занести прибыль
  9. # вывести результат
  10. for x in range(1000, 40000):
  11.     income = compute_income(x, k, n)
  12.  
  13.     if round(income) == s:
  14.         print('верно', x)
  15.     else:
  16.         print('неверно', x)
Add Comment
Please, Sign In to add comment