1
0
forked from tdwojak/Python2017

z1, z2, z3

This commit is contained in:
s45148 2017-11-28 20:51:36 +01:00
parent 740202ea3f
commit 72eb9d01e2

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): def sum_from_one_to_n(n):
ResultList = [] ResultList = []
if n <1: if n <1:
ResultList.append(0) #ResultList.append(0)
SumResult = 0
else: else:
SumResult = 0 SumResult = 0
for i in range(n+1): for i in range(n+1):
SumResult = SumResult + i SumResult = SumResult + i
ResultList.append(SumResult) #ResultList.append(SumResult)
return SumResult
def tests(f): def tests(f):
inputs = [[999], [-100]] inputs = [[999], [-100]]