Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ps019.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 5 12:07:03 2019

@author: tanma
"""

import time,calendar
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to import time. You can remove it.


calendar.setfirstweekday(6)

def sundays(year):
counter = 0
for month in range(1,13):
cal = calendar.monthcalendar(year,month)
if cal[0][0]:
counter += 1
return counter

t = int(input().strip())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it specific to the problem statement.

for a0 in range(t):
n = [int(i) for i in input().split(" ")]
ne = [int(i) for i in input().split(" ")]
total = 0
for i in range(n[0],ne[0]):
total += sundays(i)
print(total)