how to convert python list str to int
- Last modified: 08 March 2020
- Category: python tutorial
in this tutorial we'll learn how to convert a string list to int list
syntax
1 | list(map(int, your_list) |
example
1 2 3 4 5 6 7 8 | #list str_list = ['1', '2', '3', '4', '5', '6'] #convert list str to int conv = list(map(int, str_list)) #print print(conv) |
output
[1, 2, 3, 4, 5, 6]
English today is not an art to be mastered it's just a tool to use to get a result