1
0
Fork 0

z1, z2, z3

This commit is contained in:
s45148 2017-11-28 20:51:36 +01:00
parent 740202ea3f
commit 72eb9d01e2
1 changed files with 4 additions and 2 deletions

View File

@ -9,12 +9,14 @@ Jeśli podany argument jest mniejszy od 1 powinna być zwracana wartość 0.
def sum_from_one_to_n(n):
ResultList = []
if n <1:
ResultList.append(0)
#ResultList.append(0)
SumResult = 0
else:
SumResult = 0
for i in range(n+1):
SumResult = SumResult + i
ResultList.append(SumResult)
#ResultList.append(SumResult)
return SumResult
def tests(f):
inputs = [[999], [-100]]