def quarter_of(month): if month in (1,2,3): return 1 if month in (4,5,6): return 2 if month in (7,8,9): return 3 if month in (10,11,12): return 4