names_dict = {'Joe': 200, 'Anne': 400, 'Mike': 500, 'John': 1010, 'Sarah': 
    150, 'Paul': 325, 'George': 645, 'Adam': 100, 'Britney': 321}

def extract_top_n(dictionary, count):
    highest_values = []
for k, v in dictionary.items():
    print(k, v, highest_values, len(highest_values))
highest_values.append(v)
l = len(highest_values)
for i in range(l - 1):
    print(i, l)
if l - i < 1:
    break
if highest_values[l - i - 1] > highest_values[l - i - 2]:
    temp = highest_values[l - i - 2]
highest_values[l - i - 2] = highest_values[l - i - 1]
highest_values[l - i - 1] = temp
highest_values = highest_values[:count]
last_interesting = highest_values[len(highest_values) - 1]
return_dictionary = {}
for k, v in dictionary.items():
    if v >= last_interesting:
        return_dictionary[k] = v
return return_dictionary
print(extract_top_n(names_dict, 3))
New dict of top n values (and keys) from dictionary (Python)