1test_list = ['1', '4', '3', '6', '7']
2
3int_list = [int(i) for i in test_list]
1Use the map function (in Python 2.x):
2results = map(int, results)
3
4In Python 3, you will need to convert the result from map to a list:
5results = list(map(int, results))
1test_list = ['1', '4', '3', '6', '7']
2
3# Printing original list
4print ("Original list is : " + str(test_list))
5
6# using naive method to
7# perform conversion
8for i in range(0, len(test_list)):
9 test_list[i] = int(test_list[i])
10
11
12# Printing modified list
13print ("Modified list is : " + str(test_list))
14
1integers = [1, 2, 3]
2strings = [str(integer) for integer in integers]
3a_string = "". join(strings)
4an_integer = int(a_string)
5print(an_integer)