In a firm there is an intelligent employee. He said that he will not work on all those days which has factors more than 2. You are given with month and year calculate the no of working days of employee.
Input Description:
Month(M) and year(Y)
Output Description:
N denoting no of working days
my code:
put all months values into dic
x,y=input().split()
dic={"May":31,"June":30}
q=dic[x]
i=2
c=[]
while i<=q:
for j in range (1,q+1):
if ((i%j)==0):
c.append(i)
i=i+1
d = []
for x in range(2,q+1):
if c.count(x)<=2:
d.append(x)
print(len(d))
Sample Input :
May 2016
Sample Output :
11