I need to define multiple variables within a while loop to be called inside of the while loop in Python.
Code:
tau = 0
while tau < 10:
(tau)
d_abrv = "d" % tau
day = "day" % tau
d_abrv = datetime.now() + timedelta(days=tau)
day = d_abrv.strftime('%a %d-%b-%y')
image_date = d_abrv.strftime('%Y%m%d')
plt.savefig(homedir + "/out/_tmax_" + d_abrv + "_ne.png", dpi = 300)
tau = tau + 1
sys.exit()
What am I doing wrong?
Ideally, I need to define a variable that loops through number 0 through 10. After, I need to be able to use this defined variable throughout the script, including defining new variables with the variable, e.g., tau=0, change day0 to day=day+tau
(tau)? What do you expect this to do?IndentationError?