# 循环输出列表内名字
names = ['Michael','Bob','Tracy']
for name in names:
print(name)
# 计算1~10的整数之和
sum1 = 0
for x in [1,2,3,4,5,6,7,8,9,10]:
sum1 = sum1 + x
print(sum1)
# 计算0~100的整数之和,range(0,101) 含左不含右
sum2 = 0
for y in range(101):
sum2 = sum2 + y
print(sum2)
Michael
Bob
Tracy
55
5050