for loop, the function tally puts 10 into i. It returns a sum and i together.
def tally(n):
acc = 0
for i in range(n):
if i == 2:
i = 10
acc += i
return acc, i
print(tally(5))
What does the program print?Log in to join the discussion.
Loading…