Back
You can use the str() for converting the data into string format data:
myvariable = 4mystring = str(myvariable) # '4'
myvariable = 4
mystring = str(myvariable) # '4'
You can also use repr():
mystring = repr(myvariable) # '4'
This is commonly known as "conversion" in python.
31k questions
32.8k answers
501 comments
693 users