I have
term = input("Enter a variable name") #choose the term (i.e.,day,week,month)
and in my code there is a section as below
date.term
I like users can input 'month' or 'year' and the code can function as
date.month
or
date.year
How can I do this. Thank you in advance for your time and help.