Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

949 B
Raw Blame

title: Python hex() built-in function - Python Cheatsheet description: Convert an integer number to a lowercase hexadecimal string prefixed with “0x”. If x is not a Python int object, it has to define an index() method that returns an integer.

Python hex() built-in function From the Python 3 documentation Convert an integer number to a lowercase hexadecimal string prefixed with “0x”. If x is not a Python int object, it has to define an __index__() method that returns an integer.

Examples

>>> hex(1)
# '0x1'
>>> hex(10)
# '0xa'
>>> hex(100)
# '0x64'
>>> hex(1000)
# '0x3e8'