Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to use str()

#Use str() to convert a non string value into one
#Example:
VariableToConvert = 1
VariableAsAString = str(VariableToConvert)
#We can see that VariableAsAString is a string if we try do to operations on it.
#The result of trying an operation it would be: TypeError: can only concatenate str (not "int") to str
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
9+1 =