(Find the character of an ASCII code) Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:
Enter an ASCII code: 69
The character is E
Find the character of an ASCII code Program code:
# Prompt the user to enter an ASCII code
asciiCode = int(input("Enter an ASCII code: "))
# Convert the ASCII code to a character
#use default 'chr' method
character = chr(asciiCode)
# Display the character
print("The character is", character)
Executed Output 1:
Enter an ASCII code: 69
The character is E
Executed Output 2:
Enter an ASCII code: 71
The character is G