Home > Software engineering >  can anyone tell the meaning of ord in ord() function in python
can anyone tell the meaning of ord in ord() function in python

Time:10-24

ord() is used to get the ascii value of the character we insert. like ord("A") => 65 does anyone know what ord stands for? like ordinal or something else?

CodePudding user response:

It stands for ASCII code, which is a code for the most general characters, like letters, digits, point, comma, ...

More information can be found on Wikipedia.

CodePudding user response:

From the python docs for ord()

Given a string representing one Unicode character, return an integer representing the Unicode code point of that character... This is the inverse of chr().

So ord() will return the integer that represents a single character that is passed to it.

  • Related