>>> str(42)
'42'
>>> int('42')
42
Links to the documentation:
str(x)
converts any object x
to a string by calling x.__str__()
.
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]
- Converting integer to string in Python
- 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?
- 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]
- Converting integer to binary in python
- Convert floats to ints in Pandas?
- How can I convert each item in the list to string, for the purpose of joining them? [duplicate]
- Get last “column” after .str.split() operation on column in pandas DataFrame
- Converting a string that represents a list, into an actual list object
- How to search if dictionary value contains certain string with Python
- How to concatenate (join) items in a list to a single string
- How can I use f-string with a variable, not with a string literal?
- Using Python’s Format Specification Mini-Language to align floats
- f.read coming up empty
- How to remove all integer values from a list in python