Calendar Module Python Hackerrank Solution

0

The calendar module allows you to output calendars and provides additional useful functions for them.

class calendar.TextCalendar([firstweekday])

This class can be used to generate plain text calendars.

Task

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

Input Format

A single line of input containing the space separated month, day and year, respectively, in MM DD YYYY format.

Output Format

Output the correct day in capital letters.

Sample Input 


    08 05 2015

Sample Output


    WEDNESDAY

Explanation

The day on August 5th 2015 was WEDNESDAY.

Calendar Module Python Hackerrank Solution


    import calendar

    m, d, y = map(int, input().strip().split())

    print(calendar.day_name[calendar.weekday(y, m, d)].upper())


Happy learning by shouterfolk

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !