Skip to content

To convert all the elements of a string into integers in python

If a have a string, we can split its characters and then convert them to a list, if needed.

>>> a = "12345"
>>> list(map(int, a))
[1, 2, 3, 4, 5]
>>>
Back to top