Quick Guide to the Python Ord Functionby@itsmycode
1,332 reads
1,332 reads

Quick Guide to the Python Ord Function

by Srinivas Ramakrishna2mNovember 10th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Python’s ord() function accepts a single unit of character and returns the equivalent Unicode of the passed argument. In other words, the `ord()` function can take a string or character of length one and returns an integer representing the Unicode of that string. The function is nothing but the inverse of the **[Python chr()](https://itsmycode.com/python-ord-a-step-by-Step-guide) function. If the argument passed to the function is more than 1 character, Python will raise a **TypeError: 'ord() expected a character, but string of length 2 found'

Company Mentioned

Mention Thumbnail
featured image - Quick Guide to the Python Ord Function
Srinivas Ramakrishna HackerNoon profile picture
Srinivas Ramakrishna

Srinivas Ramakrishna

@itsmycode

Solution Architect having 14+ Years of Experience in .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS

About @itsmycode
LEARN MORE ABOUT @ITSMYCODE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Srinivas Ramakrishna HackerNoon profile picture
Srinivas Ramakrishna@itsmycode
Solution Architect having 14+ Years of Experience in .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here