Python-100-Days/Day01-15/code/Day04/while2.py

14 lines
175 B
Python

"""
用while循环实现1~100之间的偶数求和
Version: 0.1
Author: 骆昊
Date: 2018-03-01
"""
sum, num = 0, 2
while num <= 100:
sum += num
num += 2
print(sum)