Python ord() built-in function

From the Python 3 documentation

Given a string representing one Unicode character, return an integer representing the Unicode code point of that character.

Introduction

The ord() function is the inverse of chr(). It takes a single character string and returns its Unicode code point, which is an integer.

Examples

# Get the Unicode code point of a character
print(ord('A'))  # Output: 65
print(ord('€'))  # Output: 8364
print(ord('1'))  # Output: 49
print(ord('a'))  # Output: 97

Subscribe to pythoncheatsheet.org

Join 16,702+ Python developers in a two times a month and bullshit free publication , full of interesting, relevant links.