2020-01-12 14:35:16 +01:00
|
|
|
def list_cubed(l: list) -> object:
|
2020-01-12 15:16:10 +01:00
|
|
|
result = 0
|
2020-01-12 14:35:16 +01:00
|
|
|
|
2020-01-12 15:16:10 +01:00
|
|
|
if not l:
|
|
|
|
return result
|
|
|
|
else:
|
|
|
|
length = len(l)
|
|
|
|
while length > 0:
|
|
|
|
result += pow(l[length - 1], 3)
|
|
|
|
length -= 1
|
|
|
|
|
|
|
|
return result
|