-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime_1.py
More file actions
27 lines (26 loc) · 731 Bytes
/
time_1.py
File metadata and controls
27 lines (26 loc) · 731 Bytes
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
26
27
import time
timestamp = time.strftime('%H:%M:%S')
print(timestamp)
timestamp = time.strftime('%H')
print(timestamp)
timestamp = time.strftime('%M')
print(timestamp)
timestamp = time.strftime('%S')
print(timestamp)
hour= int(input('enter hour'))
# if (int(time.strftime('%H')) < 12):
# print('Good Morning')
# if (int(time.strftime('%H')) >= 12 ):
# print('Good Afternoon')
# if (int(time.strftime('%H')) >=17):
# print('Good Evening')
# if (int(time.strftime('%H')) >21):
# print('Good Night')
if (hour < 12):
print('Good Morning')
if (hour >= 12 and hour <17 ):
print('Good Afternoon')
if (hour >=17 and hour<21):
print('Good Evening')
if (hour >=21):
print('Good Night')