You are viewing a single comment's thread. Return to all comments →
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'} Minutes= {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: 'thirteen', 14: 'fourteen', 15: 'quarter', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', 20: 'twenty', 21: 'twenty one', 22: 'twenty two', 23: 'twenty three', 24: 'twenty four', 25: 'twenty five', 26: 'twenty six', 27: 'twenty seven', 28: 'twenty eight', 29: 'twenty nine', 30: 'half'} if m==1: ans= f'{Minutes[m]} minute past {Hours[h]}' elif m==59: ans= f'{Minutes[60-m]} minute to {Hours[h+1]}' elif m<=30 and m>1: if m not in [15,30]: ans= f'{Minutes[m]} minutes past {Hours[h]}' else: ans=f'{Minutes[m]} past {Hours[h]}' elif m==0: ans=f'{Hours[h]} o\' clock' elif m>30: if m not in [45,30]: ans= f'{Minutes[60-m]} minutes to {Hours[h+1]}' else: ans=f'{Minutes[60-m]} to {Hours[h+1]}' return ans
Seems like cookies are disabled on this browser, please enable them to open this website
The Time in Words
You are viewing a single comment's thread. Return to all comments →