According to Python documentation, ord () provides the corresponding number in Unicode. When i introduced
ord('A')
I got number 65. However, when I checked the Unicode number for "A" on a site called Unicode Table ( http://unicode-table.com/en ), it says the number is 41.
Why is this happening? What is the correct reference guide for Unicode?
"41" is in hexadecimal format.
>>> ord("A") 65 >>> hex(ord("A")) '0x41' >>> int("41",base=16) 65
Notice that at the top of the page that you linked, you see 0123456789ABCDEFwhich gives you the last digit.
0123456789ABCDEF
ord(), Python, ASCII.
.
ASCII-.
, , @DSM , ASCII- base-10 ( ). , - , 7F , ASCII- 127.