Input: a Output: 97
If given a string of length one, return an integer representing the Unicode code point of the character when the argument is is a Unicode object, or a byte value if the argument is an 8-bit string. For example, ord (& # 39; a & # 39;) returns integer 97, ord (& # 39; € & # 39;) (euro sign) returns 8364. This is the inverse of chr () for 8-bit strings and unichr () for Unicode objects. If a Unicode argument is given and Python was built using Unicode UCS2, then the character code point must be in the range [0..65535] inclusive.
If the string is longer than one and a TypeError will be thrown .
The syntax can be ord ("a") or ord (& # 39; a & # 39;), both will give the same results.
1. TypeError : Raised when line length is greater than 1.