# Euler 0019

### The Problem:

How many Sundays fell on the first of the month between Jan 1 1901 and Dec 31 2000?

### Considerations:

There is for sure a number theory mathematical way of handling this... but...

### Approach:

What if we just imported a python calendar module and counted how many Sundays were between then and now?

<div class="md-output__section has-scroll" id="bkmrk-keep-iterating-throu"></div>### The Code:

<details id="bkmrk-target_under-%3D-1000-"><summary></summary>

```python
import calendar

year = 1901
end_year = 2000

sunday_first_days = 0
for i in range(year, end_year + 1):
    this_year = calendar.Calendar().yeardayscalendar(i,12)
    for year in this_year:
        for month in year:
            for week in month:
                if week[6] == 1:
                    sunday_first_days += 1

print(sunday_first_days)
```

</details>