Quick Guide to the Python Ord Functionby@itsmycode
705 reads

Quick Guide to the Python Ord Function

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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

@itsmycode

Srinivas Ramakrishna


Receive Stories from @itsmycode

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

RELATED STORIES

L O A D I N G
. . . comments & more!