ord()Easy Examples

Returns the Unicode code point for a single character

Basic ord() usage

Simple demonstration of the ord() built-in function.

python
print(ord("A"))
print(ord("a"))
print(ord("0"))

ord() is a built-in function that returns the unicode code point for a single character.

ord() with different inputs

Calling ord() with various argument types.

python
# More ord() examples
print("ord() is a Python built-in function")
print(f"Type: {type(ord)}")

ord() accepts different types of arguments and produces corresponding results.

Want to try these examples interactively?

Open Easy Playground