Great! Let's start with the
ord() function. The
ord() function takes a character as an argument and returns a number.
This works because each character has a number assigned to it in what is called Unicode.
Unicode is an international character encoding standard. All possible characters, including characters from the Latin alphabet, like
'A'; and from national alphabets, like
'主' are given a number in Unicode.
ord() function returns the Unicode number for the given character. For example,
ord('a') returns the number
97, which is the number pointing to the character
'a' in Unicode. As you can imagine, we can transform every single character into a number.