Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to convert a datatype to another

x = "3"
int(x)

y = "2.6"
float(y)

z = "1j"
complex(z)

print(typeof(x))
# Int
# float
# complex
 
PREVIOUS NEXT
Tagged: #convert #datatype
ADD COMMENT
Topic
Name
7+6 =