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:
Use a list comprehension:
results = [int(i) for i in results]
e.g.
>>> results = ["1", "2", "3"] >>> results = [int(i) for i in results] >>> results [1, 2, 3]