Question: Write a Python program that takes an hour from the user as input and tells it is time for which meal. - The user will

 Write a Python program that takes an hour from the user

Write a Python program that takes an hour from the user as input and tells it is time for which meal. - The user will input the number in a 24-hour format. So, 14 means 2 pm, 3 means 3 am, 18 means 6pm, etc. - Valid inputs are 0 to 23. Inputs less than 0 or more than 23 are invalid in 24-hour clock. - Assume, input will be whole numbers. For example, 3.5 will NOT be given as input. Input range: Message to be printed 4 to 6: Breakfast 12 to 13: Lunch 16 to 17: Snacks 19 to 20: Dinner For all other valid inputs, say "Patience is a virtue" For all other invalid inputs, say "Wrong time

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!