ord() Unicode point of input char

ord() takes input char of single length.
returns Unicode point value of input Char.

Here are some sample outputs of single input string ( output is shown against each row after comment )
print(ord('a')) # 97
print(ord('b')) # 98
print(ord('P')) # 80
print(ord('#')) # 35
print(ord('$')) # 36
The first 128 unicode point values are same as ASCII values.

If we input more than one char then it wil return error.
TypeError: ord() expected a character, but string of length 2 found
All Built in Functions in Python
chr() returns the char by taking the Unicode point value ascii()


Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer