In [1]:
data = [10,20,3,24,3,20,40,1]
In [3]:
small = data[0]
index = 0  
index_of_small = 0  
for item in data[1:]:
    index = index + 1  
    if item < small:  
        small = item  
        index_of_small = index
print(small,index_of_small)
1 7
In [8]:
data = [10,20,3,24,3,20,40,1]
small = data[0]
index_of_small = 0  
for (index,item) in enumerate(data):
    if item < small:  
        small = item  
        index_of_small = index
print(small,index_of_small)
1 7
In [5]:
for (index,item) in enumerate([20,10,30,40,50]):
    print(index,item)
0 20
1 10
2 30
3 40
4 50
In [ ]:
small = data[0]
index_of_small = 0  
for (index,item) in enumerate(data[1:]):
    if item < small:  
        small = item  
        index_of_small = index
print(small,index_of_small)