PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Created by Shri Hunde
#THIS IS A DEVELOPED MODEL OF PREVIOUS VERSION (original code)
#ver: 1.12
try:
time = float(input()) #changed int to float
if 0 <= time < 12: # Morning (0 to 11)
print("Good Morning...")
elif 12 <= time < 17: # Afternoon (12 to 16)
print("Good Afternoon...")
elif 16 <= time < 21: # Evening (16 to 20)
print("Good evening...")
elif 21 <= time <= 23 or time == 0: # Night (21 to 23 or 0)
print("Good night...")
elif time < 0 :
print("That's not possible bro!")
else:
print("Invalid time entered. Please enter a time between 0 and 24.")
except ValueError:
print("Invalid input. Please enter a valid number.")
#THIS IS NOT A HUMAN GENERATED CODE
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run