Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python int string float

string = "3.5"
#integer = int(string) will not work, as that returns an error.
integer = int(float(string)) #This will work, as you first turn "3.5" to 3.5
                                     #then make it the integer 3
 
PREVIOUS NEXT
Tagged: #python #int #string #float
ADD COMMENT
Topic
Name
2+2 =