1
0
forked from tdwojak/Python2017

Update 'labs02/task04.py'

This commit is contained in:
s45164 2017-12-01 17:11:41 +00:00
parent 50e576e7d9
commit d2eeea8a25

View File

@ -7,9 +7,12 @@ 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):
if n<1:
return 0
else:
return n*(n+1)/2
pass pass
def tests(f): def tests(f):
inputs = [[999], [-100]] inputs = [[999], [-100]]
outputs = [499500, 0] outputs = [499500, 0]