开发者

Increase numbers in python until max

开发者 https://www.devze.com 2023-04-07 13:43 出处:网络
I want to have python spit out a bunch of numbers for me. example: >>>date = 1940 >>>da开发者_StackOverflowte += 1

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

精彩评论

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