rozwiazanie zad
This commit is contained in:
parent
3e75fff743
commit
6de4801254
@ -7,7 +7,16 @@ Jeśli podany argument jest mniejszy od 1 powinna być zwracana wartość 0.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def sum_from_one_to_n(n):
|
def sum_from_one_to_n(n):
|
||||||
pass
|
suma = 0
|
||||||
|
|
||||||
|
for i in range(n+1):
|
||||||
|
suma = suma + i
|
||||||
|
|
||||||
|
if n < 1:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return suma
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
|
Loading…
Reference in New Issue
Block a user