rozwiazanie zadania 7 z intro - rozwiazane w domu
This commit is contained in:
parent
11bee7e965
commit
c9d22aa7a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user