I've defined a few variables below and I want to use them to define a variable.
today = datetime.today()
datem = str(datetime(today.year, today.month, 1))
curr_month = datem[5:7]
curr_year = datem[2:4]
list_early_fy = ['04', '05', '06', '07', '08', '09', '10', '11', '12']
I then want to use these to define the fiscal year I'm using. I tried both methods below (the first one was what I was really looking for), but both just said "invalid syntax".
test_year = if curr_month in list_early_fy:
print(int(curr_year)+1, curr_year)
def test_year:
if curr_month in list_early_fy:
print(int(curr_year)+1, curr_year)
Finally, I want to use that "test_year" variable in other places in my code. Anyway, any suggestions on how to make this work?