zjfz-2019-s402281/intro/Task104.py

17 lines
317 B
Python
Raw Normal View History

2020-01-12 13:16:55 +01:00
#!/usr/bin/python2
2020-01-12 13:11:00 +01:00
# -*- coding: utf-8 -*-
"""Rozwiązanie zadania 104."""
2020-01-12 13:16:55 +01:00
def sum_from_one_to_n(number):
"""Placeholder"""
if number < 1:
return 0
ret = 0
for ile in range(1, number + 1):
ret += ile * ile
return ret
2020-01-12 13:11:00 +01:00
if __name__ == '__main__':
2020-01-12 13:16:55 +01:00
print sum_from_one_to_n(2015)