For循环:sum = 0For i in range(1, 101): sum += iprint(sum)# While循环:sum, i = 0, 1While i < 101: sum += i i += 1print(sum)