开发者

Increase numbers in python until max

I want to have python spit out a bunch of numbers for me. example:

>>>date = 1940
>>>da开发者_StackOverflowte += 1
>>>print str(date)
1941
>>>

but i want to loop that and output all numbers from 1940-2004


Use the range function.

for i in range(1940,2005):
   print i
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜