CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day04/while2.py
Views: 729
1
"""
2
用while循环实现1~100之间的偶数求和
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-03-01
7
"""
8
9
sum, num = 0, 2
10
while num <= 100:
11
sum += num
12
num += 2
13
print(sum)
14
15