Write a Python program that takes as input a month and year determines how many days are in the month and outputs the number of days Thirty days are in September April June and November

0 votes
Write a Python program that takes as input a month and year, determines how many days are in the month, and outputs the number of days. Thirty days are in September, April, June, and November. All the rest are 31 except for February which could be 28 or 29 depending upon whether the year is a leap year or not. In general, a year is a leap year when it is evenly divisible by 4. Exceptions occur when the year is also evenly divisible by 100 in which case the year would not be a leap year unless it is evenly divisible by 400. For example, 2000 and 2012 are leap years, but 2100 is not
Oct 5, 2021 in Python by Maruthi
• 120 points
531 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

+1 vote
1 answer
0 votes
1 answer

How to find the value of a row in a csv file in python and print column and row of that value ?

Hello @Khanhh , Use panda to find the value of ...READ MORE

answered Oct 15, 2020 in Python by Niroj
• 82,840 points
6,778 views
+5 votes
1 answer

Print the odd and even factors of a number in Python

x = int(input("Enter any number \n")) print("The factors ...READ MORE

answered Nov 19, 2018 in Python by Nabarupa
17,571 views
–1 vote
2 answers
+1 vote
1 answer
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12, 2019 in Python by Mohammad
• 3,230 points
1,205 views
0 votes
1 answer

How can I find the square of a number in python?

You can use the exponentiation operator or ...READ MORE

answered May 21, 2019 in Python by Mohammad
• 3,230 points
1,232 views
+4 votes
3 answers

Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

Try using this question by list comprehension: a=[4,7,3,2,5,9] print([x for ...READ MORE

answered Dec 9, 2019 in Python by vinaykumar
• 200 points
34,856 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP