paint-brush
Quick Guide to the Python Ord Functionby@itsmycode
1,385 reads
1,385 reads

Quick Guide to the Python Ord Function

by Srinivas RamakrishnaNovember 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'
featured image - Quick Guide to the Python Ord Function
Srinivas Ramakrishna HackerNoon profile picture
Srinivas Ramakrishna

Srinivas Ramakrishna

@itsmycode

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

About Author

Srinivas Ramakrishna HackerNoon profile picture
Srinivas Ramakrishna@itsmycode

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