image.png


lst = [8,6,9,7,5,14,32,3,78,65]

smallest_index = 0 

for i in range(0 , len(lst)):

    if lst[i] < lst[smallest_index] : 
        smallest_index = i 

print(lst[smallest_index])

image.png

# bubble sort algorithm

lst = [45,3,24,99,23,1,56,54]

for j in range(len(lst)-1):
    for i in range(len(lst)-1):
        if lst[i] > lst[i+1] : 
            #swap
            lst[i] , lst[i+1] = lst[i+1] , lst[i]

print(lst)

image.png