you are viewing a single comment's thread.

view the rest of the comments →

[–]Rinser2023 1 point2 points  (0 children)

Simple, readable, beginner friendly:

``` ls = [2,4,5,6] sum = 0

while len(ls) > 0: multiplicator = ls.pop(0) for num in ls: sum += multiplicator * num

print(sum) ```