python has a built-in function ord()
, I think it must be a anbbreviation. Just like another built-in function chr()
, which is an abbreviation of the word "character". Does anyone know the word that built-in function ord()
abbreviate for?
It stands for "ordinal". The earliest use of ord that I remember was in Pascal. There, ord() returned the ordinal value of its argument.
Python ord() Function The ord() function returns the number representing the unicode code of a specified character.
The Python ord() function converts a character into an integer that represents the Unicode code of the character. Similarly, the chr() function converts a Unicode code character into the corresponding string.
Python ord() and chr() are built-in functions. They are used to convert a character to an int and vice versa. Python ord() and chr() functions are exactly opposite of each other.
It's an abbreviation for "ordinal". Ordinal numbers are counting numbers -- i.e., 1, 2, 3. ord()
converts the character into its (countable) position in the character set.
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