TUTORIALProgrammingFETCHED
Python 练习实例45
Python 练习实例45 Python 100例 题目:统计 1 到 100 之和。 程序分析:无 程序源代码: 实例 [mycode3 type='python'] #!/usr/bin/python # -*- coding: UTF-8 -*- tmp = 0 for i in range(1,101): tmp += i print ('The sum is %d..
Updated 7/16/2026
Tutorial detail pages default to noindex.
Python 练习实例45
题目:统计 1 到 100 之和。
程序分析:无
程序源代码:
实例
#!/usr/bin/python
# -*- coding: UTF-8 -*-
tmp = 0
for i in range(1,101):
tmp += i
print ('The sum is %d' % tmp)
以上实例输出结果为:
The sum is 5050
Python 100例