Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 914 Bytes

exercise_3.md

File metadata and controls

39 lines (23 loc) · 914 Bytes

Unit 3 Practice

Exercise 3 - Days in a Month

3.1

Write a function which takes in the full name of a month and returns the number of days in that month. Use a dictionary to store the months and how many days they have in them.

Loop the code until the user chooses to exit.

Output:

Enter the full name of a month to see how many days are in it
or 'q' to quit: september
    
    September has 30 days in it.

Enter the full name of a month to see how many days are in it
or 'q' to quit: february
    
    February has 28 days in it.

Enter the full name of a month to see how many days are in it
or 'q' to quit: march
    
    March has 31 days in it.

Enter the full name of a month to see how many days are in it
or 'q' to quit: q
    
    Have a lovely day!

Exercise 3 solution