Python Char to Ascii, and Ascii to Char

February 24, 2019
ord(‘A’) and chr(65)

Char to Ascii

A_ascii = ord('A')    # 65
a_ascii = ord('a')    # 97

Ascii to Char

A_char = chr(65)      # A
a_char = chr(97)      # a
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.