Challenge: Print the Number of the Month from a Given Date

This coding challenge is based on the concept of formatted input.

Problem statement #

Write a program that reads a date in the format “year.month.day” as input and displays the “month” from that date.

Input #

Date in the format year.month.day

Output #

Number of the month

Sample input #

2009.09.30

Sample output #

9

Challenge #

This problem is designed for you to practice, so try to solve it on your own first. If you get stuck, you can always refer to the explanation and solution provided in the next lesson. Good luck!

Get hands-on with 1200+ tech skills courses.