>>> str(10)
'10'
>>> int('10')
10
Links to the documentation:
Conversion to a string is done with the builtin str()
function, which basically calls the __str__()
method of its argument.
More Related Contents:
- How to convert strings into integers?
- Is there a way to convert number words to Integers?
- Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects [duplicate]
- Python strings and integer concatenation [duplicate]
- How to split a string of space separated numbers into integers?
- How can I check if a string represents an int, without using try/except?
- How to get integer values from a string in Python?
- inheritance from str or int
- formatting long numbers as strings in python
- How do I convert all strings in a list of lists to integers?
- Convert integer to string in Python
- TypeError: cannot concatenate ‘str’ and ‘int’ objects [duplicate]
- How to convert a string of space- and comma- separated numbers into a list of int? [duplicate]
- Splitting List That Contains Strings and Integers
- How do I check if raw input is integer in python 2.7?
- Convert a string to integer with decimal in Python
- Formatting long numbers as strings
- How can I convert string values from a dictionary, into int/float datatypes?
- How can I check if a string has a numeric value in it in Python? [duplicate]
- Check if multiple strings exist in another string
- How to use string.replace() in python 3.x
- How to un-escape a backslash-escaped string?
- Python 2.7 getting user input and manipulating as string without quotations
- What is the most efficient string concatenation method in Python?
- How can I extract keywords from a Python format string?
- How to get an expression between balanced parentheses
- Parsing json and searching through it
- f.read coming up empty
- Python string operation, extract text between html tags
- Detect whether a Python string is a number or a letter [duplicate]