LogiQuest
Back to Control Flow
20

What is the output of the following code?

total = 0
for x in [3, -1, 4, -5, 2]:
    if x < 0:
        continue
    total += x
print(total)
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.