Well, I have no idea how to solve it. It has been giving the same mistake.
So this is exercise https://www.hackinscience.org/exercises/friday-the-13th.
My code:
import datetime
d = datetime.date.today()
def friday_the_13th():
if d.day == 13 and d.weekday() == 4:
return str(datetime.date.today())
year = d.year
day = 13
for month in range(1,13):
t = datetime.date(year=year, month = month, day=day)
if t.day==13 and t.weekday()==4 and t.month > d.month and d.day < 13:
return str(t)
if month==12:
for month1 in range(1,13):
t = datetime.date(year=year+1, month=month1, day=day)
if t.day == 13 and t.weekday() == 4:
return str(t)
if name == “main”:
print(friday_the_13th())