my_input = int(my_input)
There is no shorter way than using the int
function (as you mention)
More Related Contents:
- How do I parse a string to a float or int?
- How do I check if a string is a number (float)?
- Convert a Unicode string to a string in Python (containing extra symbols)
- NumPy or Pandas: Keeping array type as integer while having a NaN value
- How can I convert a string with dot and comma into a float in Python
- Checking if a string can be converted to float in Python
- Convert bytes to int?
- list to dictionary conversion with multiple values per key?
- Import pandas dataframe column as string not int
- Convert columns to string in Pandas
- Error: ‘int’ object is not subscriptable – Python
- Call int() function on every list element?
- Convert Python strings into floats explicitly using the comma or the point as separators
- Pandas reading csv as string type
- How to convert nested list of lists into a list of tuples in python 3.3?
- Converting a string that represents a list, into an actual list object
- Converting integer to digit list
- How do I check if a string represents a number (float or int)?
- Why does Python not perform type conversion when concatenating strings?
- Convert Pandas series containing string to boolean
- Python “safe” eval (string to bool/int/float/None/string)
- Convert string into Date type on Python [duplicate]
- Python3 Error: TypeError: Can’t convert ‘bytes’ object to str implicitly
- Python, Determine if a string should be converted into Int or Float
- HTML to IMAGE using Python
- How to fix TypeError: ‘int’ object is not subscriptable
- Convert opencv image format to PIL image format?
- Python’s in (__contains__) operator returns a bool whose value is neither True nor False
- How to control the parallelism or concurrency of an Airflow installation?
- Store functions in list and call them later [duplicate]