Question: Python 3 program - part (a) The months that have 31 days are January (1), March (3), May (5), July(7), August(8), October(10), and December(12). Feb

Python 3 program -

part (a) The months that have 31 days are January (1), March (3), May (5), July(7), August(8), October(10), and December(12). Feb (2) has only 28 days and the rest have 30 days: April(4), June (6), September (9), and November(11). --> Write a program that will ask the user for the numeric month, and will tell the user the number of days in that month. For example it should run like this:

Please enter a numeric month: 2

That month has 31 days.

part (b): Write a function that will accept on argument, a string. If there are any digits (numeric characters) within the string, it will add them together and print the total.

For example, if this string is passed to the function:

"This order contains 3 apples 2 bananas and 6 lemons"

Then the function should print: 11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!