Skip to content
Programmingoneonone
Programmingoneonone

Learn everything about programming

  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone
Programmingoneonone

Learn everything about programming

HackerRank Calendar Module problem solution in python

YASH PAL, 31 July 202422 October 2025

In this HackerRank Calendar Module problem solution in python, The calendar module allows you to output calendars and provides additional useful functions for them.

You are given a date. Your task is to find what the day is on that date.

HackerRank Calendar Module solution in python
>

Problem solution in Python 2 programming.

import calendar

MM, DD, YYYY = map(int,raw_input().split())
print calendar.day_name[calendar.weekday(YYYY,MM,DD)].upper()

Problem solution in Python 3 programming.

# 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 pypy programming.

# Enter your code here. Read input from STDIN. Print output to STDOUT
import calendar
m, d, y = map(int, raw_input().split())
print list(calendar.day_name)[calendar.weekday(y, m, d)].upper()

Problem solution in pypy3 programming.

from datetime import datetime
import calendar
date_str = input()
date = datetime.strptime(date_str, '%m %d %Y')
print ('{}'.format(calendar.day_name[date.weekday()]).upper())

coding problems solutions Hackerrank Problems Solutions Python Solutions HackerRank

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes