You've seen ASCII values mentioned a couple of times now, but what are they?
ASCII values are numeric representations of characters. ASCII, which stands for American Standard Code for Information Interchange, assigns each character a unique number. These numbers are used internally by computers to represent text.
For instance:
- The character 'a' has an ASCII value of 97.
- The character 'z' has an ASCII value of 122.
These values allow computers to sort and compare characters in a consistent manner. When you instruct Python to compare 'z' with 'a', it compares their ASCII values, 122 and 97 respectively, and follows the logic designed in your code. This concept underpins the character comparison in our exercise, showing why 'z' is not considered less than 'a'.