i = 0 b = 0 list_1 =list() # print(type(list_1)) while i<99: i +=1 list_1.append(i) b =-(i+1) list_1.append(b) print(list_1) i += 1 ret =sum(list_1) print(ret)
求1-2+3-4+5 ... 99的所有数的和