Exercise 1: Number of Days in a Month
Write code to calculate the number of days in a month.
We'll cover the following
Problem statement
Given a month
containing a number from one to 12 and a leap_year
variable set to true
or false
, return the number of days in that month.
Examples
Input:
month = 3
leap_year = true
Output:
result = 31
Input:
month = 2
leap_year = true
Output:
result = 29
Try it yourself
def count_Days(month, leap_year)# start your code herereturn resultend