# In Python, the ASCII character set consists of 128 characters, including standard English letters, numbers, punctuation marks, and control characters.
#Extended ASCII, also known as ISO-8859-1 or Latin-1, expands the ASCII character set to include an additional 128 characters, totaling 256 characters.
#To work with extended ASCII characters in Python, you can utilize Unicode encoding and decoding. Python's built-in chr() and ord() functions can convert between Unicode code points and characters.
#Here's an example that demonstrates how to work with extended ASCII characters:
# Encoding extended ASCII character
extended_ascii_char = 'Æ'
unicode_code_point = ord(extended_ascii_char)
print(f"Unicode code point: {unicode_code_point}")
# Decoding Unicode code point to extended ASCII character
unicode_code_point = 198
extended_ascii_char = chr(unicode_code_point)
print(f"Extended ASCII character: {extended_ascii_char}")
Output:
Unicode code point: 198
Extended ASCII character: Æ
# In the above code, we encode the extended ASCII character 'Æ' using the ord() function, which returns its Unicode code point. We store the result in the unicode_code_point variable and print it.
# Next, we decode the Unicode code point 198 back to the extended ASCII character using the chr() function. The resulting character 'Æ' is stored in the extended_ascii_char variable and printed.
# You can perform similar operations with other extended ASCII characters by specifying the appropriate Unicode code points. Remember that Unicode code points beyond 128 correspond to the extended ASCII character set.