Menu

[solved] – Question 97499

7.1 Code Practice: Question 3
In the last problem, we get an error if we enter more than one character at a time. Rewrite the program so that it only calls the ord method if a single character is entered.

Sample Run

Enter a character: *
ASCII #42

Enter a character: exit
Not a character
The previous code was
x = input(“Enter a character: “)
print (“ASCII #” + str(ord(x)))

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *