-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeTimeInWords.py
56 lines (55 loc) · 1.13 KB
/
theTimeInWords.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
mins = {
1:"one minute",
2:"two minutes",
3:"three minutes",
4:"four minutes",
5:"five minutes",
6:"six minutes",
7:"seven minutes",
8:"eight minutes",
9:"nine minutes",
10:"ten minutes",
11:"eleven minutes",
12:"twelve minutes",
13:"thirteen minutes",
14:"fourteen minutes",
15:"quarter",
16:"sixteen minutes",
17:"seventeen minutes",
18:"eighteen minutes",
19:"nineteen minutes",
20:"twenty minutes",
21:"twenty one minutes",
22:"twenty two minutes",
23:"twenty three minutes",
24:"twenty four minutes",
25:"twenty five minutes",
26:"twenty six minutes",
27:"twenty seven minutes",
28:"twenty eight minutes",
29:"twenty nine minutes",
30:"half"
}
hours = {
1:"one",
2:"two",
3:"three",
4:"four",
5:"five",
6:"six",
7:"seven",
8:"eight",
9:"nine",
10:"ten",
11:"eleven",
12:"twelve",
13:"one"
}
h = int(raw_input())
m = int(raw_input())
if m == 0:
print hours[h] + " o' clock"
elif m <= 30:
print mins[m] + " past " + hours[h]
else:
print mins[60-m] + ' to ' + hours[h+1]