Retrieving Data Type

x = 5
print(type(x))

Typecasting

r = 2.3921
a = int(r)

Primitive

DatatypeUse-case
byte1 byte
short2 bytes
int4 bytes
char4 bytes. single ascii character
long8 bytes
floata float with wordsize
doublea float with length of twice wordsize
boolean1 byte. true or false flag
bytesthe bytes representation
bytearrayarray of bytes from a string
memoryviewa buffer
NoneTypeno type at all
Also includes the C Datatypes through the ctypes library

Advanced

DatatypeUse-case
strholds unlimited due to Polymerization. holds string data
complexcomplex numbers like
listnon-uniform array. a list of varying types
tupletuple of values
rangeinteger array
dicta key-value mapping
setset of values
frozensetimmutable set