Coggle requires JavaScript to display documents.
def program1(x): total = 0 for i in range(1000): total += i while x > 0: x -= 1 total += x return total
def program2(x): total = 0 for i in range (1000): total = i while x > 0: x = x//2 total += x return total