python小学堂1
作者:互联网
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
标签:elif,python,sun,start1,while,break,start,学堂 来源: https://www.cnblogs.com/nyqxiaoqiang/p/11777431.html