- Code: Select all
for i in range(first_year, last_year+1)
Your str() is within commas, thus it is just a string. You want the result of a built-in function str() that returns a string. You also do not even need to change the data directly to a string as you can use the str.format() method. What is date_range suppose to be?
So generally I want the time period of 01/08 to the 31/10 every year from 1979-2013, is there a better way of doing this???
What do you mean by time period? Do you want the number of days, months, a list of dates, etc.? http://lmgtfy.com/?q=python+get+months+ ... +two+dates
I would use the datetime
module as opposed to for looping through