Sunday 27 October 2019

Python program to display Good Morning message based in given time

Python program to display Good Morning message based in given time.


time = int(input("Enter your time:"))

if time < 12:
    print ("Good Morning...")

print("Have a nice time...")

Output of Program

Enter your time:5
Good Morning...
Have a nice time...

Note: If user enters time greater than 12 then program will display only "Have a nice time..." message.

No comments:

Post a Comment