Project

General

Profile

Actions

workflow #7

closed

Написать функцию вычисления n-го члена арифметической прогрессии

Added by Никита Борисов about 2 months ago. Updated about 2 months ago.

Status:
completed
Priority:
default
Start date:
11/02/2024
Due date:
11/02/2024
% Done:

0%

Estimated time:
1:00 h

Description

Написать функцию вычисления n-го члена арифметической прогрессии с членами 1,2,3 ... и тд.

Actions #1

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

Actions #2

Updated by Никита Борисов about 2 months ago

  • Status changed from todo to in progress
Actions #3

Updated by Никита Борисов about 2 months ago

  • Status changed from in progress to in qa
Actions #4

Updated by Никита Борисов about 2 months ago

  • Status changed from in qa to completed
Actions

Also available in: Atom PDF