16 lines
321 B
Python
16 lines
321 B
Python
|
# -*- 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
|