I'm trying to do an exercise on functions in Python with the following statement: "Make a program that converts from 24-hour notation to 12-hour notation". Example: Convert 14:25 to 2:25 PM. The program should contain two functions, one that converts the time and another that prints the time (with AM or PM).
I've gotten to some extent, but now I'm doubtful why the program is not running.
My program:
hora = int(input("Digite a hora: "))
minuto = int(input("Digite os minutos: "))
def converter_hora(hora):
return (hora -12)
def imprime_hora(hora,minuto):
if(hora <= 12):
print(hora,minuto,"AM")
else:
print(converter_hora,minuto,"PM")
print(imprime_hora)
Python is returning the following message:
function prints_time at 0x02D8C0C0
Any suggestions?