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
Convert string list of lists to integer in python - Stack Overflow
Each element inside the big list, we need to make it String and replace the ' by the empty string then split with space so you can get the list of elements with string type but you need to convert it to integer. 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.
🌐
Medium
medium.com › @nawazmohtashim › convert-string-list-to-integer-list-in-python-489a61684496
Convert String List to Integer List in Python | by Mohd Mohtashim Nawaz | Medium
December 11, 2023 - The most straightforward approach to converting a string list to an integer list is by using a for loop.
🌐
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:
🌐
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!

🌐
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 ...
🌐
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
🌐
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)
🌐
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.
🌐
Programming Idioms
programming-idioms.org › idiom › 258 › convert-list-of-strings-to-list-of-integers › 7564 › python
Convert list of strings to list of integers, in Python
March 10, 2021 - Convert string to integer · Filter and transform list · Read list of integers from stdin · Cheatsheets · Issues · Report a bug · × · Python · b = tuple(int(string) for string in a) Python · b = list(int(string) for string in a) Python · b = [int(elem) for elem in a] Python ·