According to the Python documentation, ord() gives the corresponding number in Unicode. When I entered
ord('A')
I got the number 65. However, when I checked the Unicode number for 'A' in the site called Unicode Table (http://unicode-table.com/en), it says the number is 41.
Why is that happening? What is the correct reference guide to Unicode?
"41" is in hexadecimal.
>>> ord("A")
65
>>> hex(ord("A"))
'0x41'
>>> int("41",base=16)
65
Note that along the top of the page you linked, you see 0123456789ABCDEF
, which is giving you the last digit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With