Type Conversion

conversion of one data type into another.

int(obj)

int(obj) method

converts any data type into integer type.

float(obj)

float(obj) method

converts any data type into float type.

ord(obj)

ord(obj) method

converts characters into integer representation (unicode).

hex(obj)

hex(obj) method

converts integers to hexadecimal.

oct(obj)

oct(obj) method

converts integer to octal.

tuple(*obj)

tuple(*obj) method

convert to a tuple, or create tuple from values.

set(*obj)

set(*obj) method

convert to a set, or create set from values.

list(*obj)

list(*obj) method

convert any data type to a list type, or create list from values.

dict(**obj)

dict(**obj) method

convert a tuple of (key,value) into a dictionary, or create dict from values.

str(obj)

str(obj) method

convert integer into a string.

Type Conversion — Structure map

Clickable & Draggable!

Type Conversion — Related pages: