Vitaliy_Novichikhin

stepik 2.1.10 elif

Jun 12th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 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(9600, 9630):
  11.     income = compute_income(x, k, n)
  12.  
  13.     if round(income) == s:
  14.         print('Верно', x)
  15.     elif round(income) != s:
  16.         print('неверно', x)
Add Comment
Please, Sign In to add comment