Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q: How many months contain 28 days? A: (see today's title!) Instructions Okay, so all days contain 28 days, but many months have a few

Q: How many months contain 28 days? A: (see today's title!)

Instructions

Okay, so all days contain 28 days, but many months have a few more! Bad jokes aside, todays problem deals with the number of days in a month.

We will give you an integer from 1 to 12 (representing the month of the year, with 1=January, 2=February and so on). Your job is to return the number of days in that month. Assume that it is NOT a leap year (i.e. February only has 28 days).

Details

Input

Read in the following input:

  • month: an integer representing the month of the year.
    • NOTE: You can assume proper input (a number from 1-12). You do not have to check for this.

Processing

  • Determine how many days are in the month (it is not a leap year)

Output

  • Output the number of days in the month as an integer.

Sample input/output:

Sample input Sample output
1 31
2 28
3 31
4 30
5 31
6 30
7 31
8 31
9 30
10 31
11 30
12

31

Using python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions