forked from tdwojak/Python2017
done
This commit is contained in:
parent
77ffeebaea
commit
36e78f1dfa
@ -7,8 +7,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):
|
||||||
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):
|
||||||
inputs = [[999], [-100]]
|
inputs = [[999], [-100]]
|
||||||
|
Loading…
Reference in New Issue
Block a user