2 ways to convert Python list of strings to integers 🐍 #shorts

preview_player
Показать описание
1. list comprehension: [ int(x) for x in list1]
2. functional: list(map(int, list1))
I think list comprehension is easier to read, but will use functional for a list of lists to keep from nesting list comprehensions.
Рекомендации по теме