How can I change any data type into a string in Python?
myvariable = 4 mystring = str(myvariable) # '4'
also, alternatively try repr:
mystring = repr(myvariable) # '4'
This is called "conversion" in python, and is quite common.
1.4m articles
1.4m replys
5 comments
57.0k users