Input Format
A single line of input containing the space separated month, day and year, respectively, in    format.
Constraints
Output Format
Output the correct day in capital letters.

hackerrank module problem solution in python programming language

Problem solution in python 3 programming language.

import calendar

day = {0:'MONDAY', 1:'TUESDAY', 2:'WEDNESDAY', 3:'THURSDAY', 4:'FRIDAY', 5:'SATURDAY', 6:'SUNDAY'}

m,d,y = map(int,input().split())
print(day[calendar.weekday(y,m,d)])

Second solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
import calendar
#calendar.Calendar(calendar.SUNDAY)
user_input = input().split()
month = int(user_input[0])
day = int(user_input[1])
year = int(user_input[2])
c = calendar.weekday(year, month, day)
if c == 0:
    print("MONDAY")
elif c == 1:
    print("TUESDAY")
elif c == 2:
    print("WEDNESDAY")
elif c==3:
    print("THURSDAY")
elif c==4:
    print("FRIDAY")
elif c== 5:
    print("SATURDAY")
elif c==6:
    print("SUNDAY")

Problem solution in python 2 programming language.

import calendar

day = {0:'MONDAY', 1:'TUESDAY', 2:'WEDNESDAY', 3:'THURSDAY', 4:'FRIDAY', 5:'SATURDAY', 6:'SUNDAY'}

m,d,y = map(int,raw_input().split())
print day[calendar.weekday(y,m,d)]