I am trying to def a function which will return the current quarter of the year in a string.
import datetime
date = datetime.datetime(2022,1,1)
month = date.month
year = date.year
if month ==1 or 2 or 3:
quarter = 'Q1'
if month ==4 or 5 or 6:
quarter = 'Q2'
if month ==7 or 8 or 9:
quarter = 'Q3'
if month ==10 or 11 or 12:
quarter = 'Q4'
lookup = quarter +str(year)
print(lookup)
when I run this function I get Q42022. Am I missing something in the if/or statements.
Any help would be greatly appreciated.