Good morning colleagues could tell me what error my code has when executing it always what is in the "except ValueError" I have already tried doing it in other ways and it does not give me this is my code:
#-*coding:utf-8-*-
'''7. Construir una función que reciba como parámetro un carácter y retorne el código ASCII
asociado a él'''
def codigo_ascii(valor):
valor=int(valor)
return(valor)
def main():
try:
letra=str(input("Digite un caracter :"))
caracter=codigo_ascii(letra)
print(caracter)
except ValueError:
print("El valor digitado no puede ser numerico")
if __name__=='__main__':
main()