I am trying to convert inputted time into word format using functions.
I tried asking input for the hour and min separate, then covering the number to appropriate word. Also, being sure the hr doesn't exceed 12 and the min doesn't exceed 59. Here is what I have so far.
def main() :
timeHour = int(input("Please enter current hour: "))
timeMin = int(input("Please enter your current minitues: "))
print(intName(timeHour, timeMin))
## Turns a number into its English name
#
def intName(timeHour, timeMin) :
name = timeMin
part = timeHour
if name >= 59 :
part == 'Invalid time, please try again!'
name == ''
if part > 12 or part < 1 :
part == 'Invalid time, please try again!'
name == ''
else:
name == ''
return name
## Turns minutes into its English name
def minName(timeMin) :
if number == 0 : return "o clock"
if number == 1 : return "one"
if number == 1 : return "one"
if number == 2 : return "two"
if number == 2 : return "two"
if number == 3 : return "three"
if number == 3 : return "three"
if number == 4 : return "four"
if number == 4 : return "four"
if number == 5 : return "five"
if number == 6 : return "six"
if number == 7 : return "seven"
if number == 8 : return "eight"
if number == 9 : return "nine"
if number == 10 : return "ten"
if number == 11 : return "eleven"
if number == 12 : return "twelve"
if number == 13 : return "thirteen"
if number == 14 : return "fourteen"
if number == 15 : return "quarter after"
if number == 16 : return "sixteen"
if number == 17 : return "seventeen"
if number == 18 : return "eighteen"
if number == 19 : return "nineteen"
if number == 20 : return "twenty"
if number == 21 : return "twenty-one"
if number == 22 : return "twenty-two"
if number == 23 : return "twenty-three"
if number == 24 : return "twenty-four"
if number == 25 : return "twenty-five"
if number == 26 : return "twenty-six"
if number == 27 : return "twenty-seven"
if number == 28 : return "twenty-eight"
if number == 29 : return "twenty-nine"
if number == 30 : return "thirty"
return ""
## Turns minutes into its English name
def hourName(timeHour) :
if digit == 1 : return 'one'
if digit == 2 : return 'two'
if digit == 2 : return 'two'
if digit == 3 : return 'three'
if digit == 3 : return 'three'
if digit == 4 : return 'four'
if digit == 4 : return 'four'
if digit == 5 : return 'five'
if digit == 6 : return 'six'
if digit == 7 : return 'seven'
if digit == 8 : return 'eight'
if digit == 9 : return 'nine'
if digit == 10 : return 'ten'
if digit == 11 : return 'eleven'
if digit == 12 : return 'twelve'
return ''
# Start the program.
main()
I'm not sure what I am doing wrong here, any suggestions?