Quick Guide to the Python Ord Function


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’



Source link

Latest

Dubai airport targets 28 million passengers this year, CEO says

Article content DUBAI — Dubai’s state airport operator is hoping for a “flood” of travelers as the coronavirus pandemic eases, targeting passenger traffic...

Jessie J is ‘filming a documentary’ to showcase her ‘career relaunch’ while five months pregnant

Jessie J is reportedly 'filming a documentary' to showcase the relaunch of her career and is 'determined' to not let being five months...

Government suspends issuing export benefits under key schemes

The government on Thursday said it has put on hold issuing benefits under various export promotion schemes due to changes in the allocation...

Is Outsourcing HR the Right Option for my Small Business?

A lot of small business owners only learn that they can outsource their HR functions well after they start their operation, and it’s understandable....