What is the easiest way to convert list with str into list with int in Python?
For example, we have to convert ['1', '2', '3'] to [1, 2, 3]. Of course, we can use a for loop, but it’s too easy.
What is the easiest way to convert list with str into list with int
Share
Python 2.x:
Python 3.x (in 3.x,
mapreturns an iterator, not a list as in 2.x):mapdocumentation: 2.6, 3.1