First time here? Checkout the FAQ!
x
+1 vote
393 views
asked in Python Interview Questions by (1.4k points)  
  

1 Answer

0 votes
answered by (1.4k points)  

Type conversion refers to the conversion of one data type into another.

int() - converts any data type into integer type

float() - converts any data type into float type

ord() - converts characters into integer

hex() - converts integers to hexadecimal

oct() - converts integer to octal

tuple() - This function is used to convert to a tuple.

set() - This function returns the type after converting to set.

list() - This function is used to convert any data type to a list type.

dict() - This function is used to convert a tuple of order (key,value) into a dictionary.

str() - Used to convert integer into a string.

complex(real,image) - This function converts real numbers to complex(real,image) number.

Related questions

...