Python-100-Days/Day04/while1.py

17 lines
156 B
Python

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