Answer:
ch= str(input("Enter a character: "))
if str.isalpha(ch)==True:
print("ASCII #%d" %ord(ch))
else:
print("Not accepted")
Step-by-step explanation:
Above, we check if the input is an alphabet, and only then ord is called or else Not accepted message is printed.