out = []
cp = rays_starters.copy()
while cp:
    mn = float('inf')
it = None
for k, v in list(cp.items()):
    if v[1] < mn:
        mn = v[1]
it = k, v
out.append(it)
del cp[it[0]]
for k, v in out:
    pass
Looping over a dictionary to display key and values in order of a value