标签:pytho tar 入门 int == lse pre else start
1 start =1
2 sum =0
3 while start <100:
4 if start % 2 ==0:
5 sum =sum -start
6 else:
7 sum =sum + start
8 start =start+1
9 print(sum)
python入门:求1-2+3-4+5...99的所有数的和
标签:pytho tar 入门 int == lse pre else start
原文地址:https://www.cnblogs.com/yspass/p/8982891.html