

# https://www.globalsino.com/ICs/page4853.html
# Find minimum and maximum values in a list


L = [1, 2, 3, 4, -6, 9, 4, 56, 6, 9]

m_max = L[0]
m_min = L[0]
idx_max = 0
idx_min = 0
c = 0
for i in L:
    if i< m_max:
        m_max = i
        idx_max = c
    elif i> m_min:
        m_min = i
        idx_min = c
    c+=1
    
print('The index and value at the minimum are: ', idx_max,' and', m_max)
print('The index and value at the maximum are: ', idx_min,' and', m_min)

