We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. Python
  3. Date and Time
  4. Calendar Module
  5. Discussions

Calendar Module

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • lasanranatunge
    5 months ago+ 0 comments

    ---------------------------------------MY SOLUTION--------------------------------------

    1. Assign values to three vars (day, month, year) using string index.
    2. Store the calendar in a variable. cal = calendar.weekday(year, month, day)
    3. Create a list to hold days of the week starting from monday. (0th element is monday).
    4. Iterate over the list elements and print out the respective list element which is equal to the value in cal variable https://colab.research.google.com/drive/12QEMyeN8SyuFAxjwgKdLcqMm__0gV5rT?usp=sharing
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy