Skip to content

Python for Hacking

Quintin edited this page Sep 7, 2022 · 3 revisions

Turning a number into a hexadecimal string with hex:

>>> hex(11)
'0xb'

Turning a character into its numeric representation with ord

>>> ord('A')
65

Turning a number into its character representation with chr

>>> chr(66)
'B'
Clone this wiki locally