xxxxxxxxxx
lis = ['1', '-4', '3', '-6', '7']
res = [eval(i) for i in lis]
print("Modified list is: ", res)
xxxxxxxxxx
test_list = ['1', '4', '3', '6', '7']
int_list = [int(i) for i in test_list]
xxxxxxxxxx
a_string = "1 2 3"
a_list = a_string. split()
#a_list >>> ['1','2','3']
int_list = [int(i) for i in list]
xxxxxxxxxx
List<String> stringList = new ArrayList<String>(Arrays.asList("10", "30", "40",
"50", "60", "70"));
List<Integer> integerList = stringList.stream()
.map(Integer::valueOf).collect(Collectors.toList());
xxxxxxxxxx
list_of_strings = ['1', '5', '7', '45', '67']
list_of_ints = [int(item) for item in list_of_strings]
print(list_of_ints)