In Python, I want to convert all strings in a list to integers.
So if I have:
results = ['1', '2', '3']
How do I make it:
results = [1, 2, 3]
Use the map function (in Python 2.x):
map
results = map(int, results)
In Python 3, you will need to convert the result from map to a list:
results = list(map(int, results))
2.1m questions
2.1m answers
60 comments
57.0k users