码迷,mamicode.com
首页 > 编程语言 > 详细

python小学堂1

时间:2019-11-01 16:57:44      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:art   spl   img   +=   show   span   bsp   splay   tar   

sun=0
start=1
while True:
    start1=start%2
    if start1==1:
        sun = start + sun
    elif start1==0:
        sun=sun-start
    if start==100:
        break
    start += 1
print(sun)
 1 sun=0
 2 start=1
 3 while True:
 4     start1=start%2
 5     if start1==1:
 6         sun = start + sun
 7     elif start1==0:
 8         sun=sun-start
 9     if start==100:
10         break
11     start += 1
12 print(sun)
技术图片
sun=0
start=1
while True:
    start1=start%2
    if start1==1:
        sun = start + sun
    elif start1==0:
        sun=sun-start
    if start==100:
        break
    start += 1
print(sun)
View Code
技术图片
 1 sun=0
 2 start=1
 3 while True:
 4     start1=start%2
 5     if start1==1:
 6         sun = start + sun
 7     elif start1==0:
 8         sun=sun-start
 9     if start==100:
10         break
11     start += 1
12 print(sun)
View Code

 

python小学堂1

标签:art   spl   img   +=   show   span   bsp   splay   tar   

原文地址:https://www.cnblogs.com/nyqxiaoqiang/p/11777431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!