I want to determine if a day on the date is Monday and then print the date as of Friday's date i.e. Monday-3. I am trying this following code.
def giveDate(date):
if datetime.today().weekday()==0:
print("Monday")
date=date-3
print(date)
giveDate("2022-08-15")
I am getting the following error line 39, in giveDate
if datetime.today().weekday()==0:
AttributeError: module 'datetime' has no attribute 'today'