Given:

xs = ['1', '2', '3']

Use map then list to obtain a list of integers:

list(map(int, xs))

In Python 2, list was unnecessary since map returned a list:

map(int, xs)
Answer from cheeken on Stack Overflow
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java list โ€บ convert a list of strings to a list of integers
Convert a List of Strings to a List of Integers | Baeldung
June 9, 2025 - In this short article, weโ€™ve learned three ways to convert List<String> to List<Integer>. Stream API would be the most straightforward conversion method if we work with Java 8 or a later version.
Discussions

java - Convert List<String> to List<Integer> directly - Stack Overflow
After parsing my file " s" contains AttributeGet:1,16,10106,10111 So I need to get all the numbers after colon in the attributeIDGet List. I know there are several ways to do it. But is there any... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to convert string list to int list?
This is not how you would do this in Python. Any time you see code with range(len(something)), you know you are doing it wrong. The way to do it would be this: numbers = [int(num) for num in numbers] More on reddit.com
๐ŸŒ r/learnpython
8
5
June 4, 2023
Converting string in a list to integers
You'll want to rebuild/replace the list. x = [int(n) for n in x] Or, x = list(map(int, x)) If the list is extremely large and you want to do the changes in place, use the index with enumeration. for index, element in enumerate(x): x[index] = int(element) From your post, you never modify x, you simply convert each element to an integer and display them. You never save them back to the original list. More on reddit.com
๐ŸŒ r/learnpython
2
1
May 15, 2022
c# - How to convert List<string> to List<int>? - Stack Overflow
My question is part of this problem: I receive a collection of id's from a form. I need to get the keys, convert them to integers and select the matching records from the DB. [HttpPost] public More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-converting-all-strings-in-list-to-integers
Converting all Strings in a List to Integers - Python - GeeksforGeeks
July 11, 2025 - List comprehension provides a more Pythonic and concise way to convert a list of strings to integers as it combines the conversion and iteration into a single line of code.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-convert-list-of-numerical-string-to-list-of-integers
Python | Convert list of numerical string to list of Integers - GeeksforGeeks
July 11, 2025 - The task performed in the above function can also be reduced to include the map function which binds the conversion to an integer to a function and the rest of the task is performed by the list comprehension function itself. ... # Python3 code to demonstrate # converting string list to integer list # using list comprehension + map() # initializing list test_list = [['24'], ['45'], ['78'], ['40']] # printing original list print("The original list : " + str(test_list)) # using list comprehension + map() # converting string list to integer list res = [list(map(int, list(sub[0]))) for sub in test_list if sub] # print result print("The list after conversion : " + str(res))
Find elsewhere
๐ŸŒ
Finxter
blog.finxter.com โ€บ how-to-convert-a-string-list-to-an-integer-list-in-python
How to Convert a String List to an Integer List in Python โ€“ Be on the Right Side of Change
April 9, 2021 - The most Pythonic way to convert a list of strings to a list of ints is to use the list comprehension [int(x) for x in strings]. It iterates over all elements in the list and converts each list element x to an integer value using the int(x) built-in function.
๐ŸŒ
Techie Delight
techiedelight.com โ€บ home โ€บ java โ€บ convert list of string to integer list in java
Convert List of String to Integer List in Java | Techie Delight
July 7, 2026 - If the value of the specified string is negative (string prefixed with ASCII character โ€˜-โ€˜ ), the solution should preserve the sign in the resultant integer. We can use Java 8 Stream to convert List<String> to List<Integer>. Following are the complete steps:
๐ŸŒ
PythonForBeginners.com
pythonforbeginners.com โ€บ home โ€บ list of strings to list of integers in python
List of Strings to List of Integers in Python - PythonForBeginners.com
April 1, 2022 - We can convert a list of strings to a list of integers using a for loop and the int() function. For this, we will first create an empty list named output_list. After that, we will traverse the list of strings using the for loop. While traversal, we will convert each string element to an integer ...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ converting string in a list to integers
r/learnpython on Reddit: Converting string in a list to integers
May 15, 2022 -

Hi Everyone,

I'm completely new to python and am completing the Python for Everybody specialisation on Coursera. I am trying to convert strings in a list to integers but my code isn't working. I did manage to get it done with list comprehension but was confused as to why this isn't working. My code is below:

x = ['1','2','3','4'] #create list of numbers as strings
for i in x:
    i = int(i) #iterate through each entry in the list and convert it to int from str
print(x)

The output I'm getting from this is still:

['1', '2', '3', '4']

Thanks for all the help!

๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-convert-strings-to-integer-lists-465116
How to convert strings to integer lists | LabEx
## Method 1: List Comprehension ... manipulation. The most straightforward method for converting strings to integers is using the int() function:...
๐ŸŒ
YouTube
youtube.com โ€บ watch
Python Tips: Converting a string list to an integer list, in 1 line - YouTube
A simple easy way to turn a list of strings into integers in python, all in one line.
Published: March 8, 2021
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ scala collections โ€บ convert a list of string to list of int in scala
Convert a List of String to List of Int in Scala | Baeldung on Scala
March 25, 2024 - In this article, we learned how to convert a List of String into a List of Int using the Scala standard library by mapping each element with the handy String.toInt() method.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-integers-string-to-integer-list
Python - Integers String to Integer List - GeeksforGeeks
July 15, 2025 - Using list comprehension allows you to create a new list by applying an expression to each element of an iterable. This method is compact and often more readable than traditional loops, making it ideal for transforming or filtering elements of a list or string. ... # Input string of integers s = "1 2 3 4 5" # Convert the string to a list of integers using list comprehension int_list = [int(i) for i in s.split()] # Print the result print(int_list)
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ converting-all-strings-in-list-to-integers-in-python
Converting all strings in list to integers in Python
The most Pythonic approach uses list comprehension with the int() function to iterate through each element and convert it ? string_numbers = ['5', '2', '-43', '23'] # Given list print("Given list with strings:") print(string_numbers) # Using list comprehension with int() integers = [int(i) for i in string_numbers] # Result print("The converted list with integers:") print(integers)