Actions
workflow #7
closedНаписать функцию вычисления n-го члена арифметической прогрессии
Start date:
11/02/2024
Due date:
11/02/2024
% Done:
0%
Estimated time:
1:00 h
Description
Написать функцию вычисления n-го члена арифметической прогрессии с членами 1,2,3 ... и тд.
Updated by Дьяконов Александр about 2 months ago
def f(n):
if n == 1:
return 1
if n == 2:
return 2
if n > 2:
return f(n-1) + 1
a = 1
while a != 0:
n = int(input())
print(f(n))
if n == 0:
a = 0
Updated by Никита Борисов about 2 months ago
- Status changed from todo to in progress
Updated by Никита Борисов about 2 months ago
- Status changed from in progress to in qa
Updated by Никита Борисов about 2 months ago
- Status changed from in qa to completed
Actions