Variables within a function

Writing a function to calculate date based on relativedelta. How do I make the ‘frequency’ a variable? e,g, relativedelta(years=5), ability to define frequency: "years", "months", "days" etc.. Tried f-string literal but i think the apostrophe is giving issues. def date_ago(date, period, frequency): """date: "yyyy-mm-dd" frequency: "years", "months", "weeks", "days" period: interger """ date_ago = datetime.strptime(date,… Read More Variables within a function