How would one write a code to display the conversion of individual letters in a string to it's ASCII equivalent? One example of the output in shell would look like this:
Enter a 3-letter word: Hey
H = 72
e = 101
y = 121
How would one write a code to display the conversion of individual letters in a string to it's ASCII equivalent? One example of the output in shell would look like this:
Enter a 3-letter word: Hey
H = 72
e = 101
y = 121
Get the input, and print each character plus its ordinal value.
user_input = input("Enter a 3-letter word: ")
for character in user_input:
print(character + " = " + ord(character))