zjfz-2019-s402281/intro/Task107.py

16 lines
321 B
Python
Raw Normal View History

2020-01-12 13:11:00 +01:00
# -*- coding: utf-8 -*-
"""Rozwiązanie zadania 107."""
def list_cubed(array):
"szczescian elementow listy"
result = 0
length = len(array)
if length == 0:
return result
else:
while length > 0:
result += pow(array[length - 1], 3)
length -= 1
return result