rozwiazanie zadania 7 z intro - rozwiazane w domu

This commit is contained in:
B. Piatek 2020-01-12 15:16:10 +01:00
parent 11bee7e965
commit c9d22aa7a4

View File

@ -1,11 +1,12 @@
def list_cubed(l: list) -> object:
result = 0
if not l:
return 0
sum = 0
for i in range(l):
sum = sum + (i*i*i)
return sum
return result
else:
length = len(l)
while length > 0:
result += pow(l[length - 1], 3)
length -= 1
return result