Вы можете просто посчитать это:
from collections import Counter
from datetime import date, timedelta
SUNDAY = 6
c = Counter()
for i in range(365):
day = date(2018, 1, 1) + timedelta(days=i)
if day.weekday() == SUNDAY:
c[day.month] += 1
# prints {4, 7, 9, 12}
print({month for month in c if c[month] >= 5})