z1, z3
This commit is contained in:
parent
b932a8291e
commit
a4151ff0a0
@ -7,8 +7,15 @@ 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
|
ResultList = []
|
||||||
|
for z in
|
||||||
|
if n <1:
|
||||||
|
ResultList.append(0)
|
||||||
|
else:
|
||||||
|
SumResult = 0
|
||||||
|
for i in range(n+1):
|
||||||
|
SumResult = SumResult + i
|
||||||
|
ResultList.append(SumResult)
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
inputs = [[999], [-100]]
|
inputs = [[999], [-100]]
|
||||||
|
Loading…
Reference in New Issue
Block a user