The term ASCII (American Standard Code for Information Interchange) refers to a defined character encoding. It assigns certain codes to characters such as letters, digits and punctuation marks. The ASCII code is used to specify how the characters are displayed by electronic devices – such as PCs or smartphones. This is an important part of many programming operations.
|1||Prompts the user to enter a character that will be treated as an integer value. The value is stored in the variable named |
|6 – 7||Outputs the ASCII value of |
character = input("Please enter character: ") asciiValue = ord(character) originalValue = chr(asciiValue) print("ASCII value of the character " + repr(originalValue) + " is: " + repr(asciiValue))
Please enter character: c ASCII value of the character 'c' is: 99