Replace
day < 31or month == 11
with
day < 31 or month == 11
Python interprets 31or as a wrong number, that’s the root cause
31or