#!/usr/bin/env python3
from random import randint
if __name__ == '__main__':
# list comprehension is cool stuff
# open the csv file
# read the file
# splitting on new line characters
# loop for each line in the file
# condition is each non empty line
# make tuple from first index of line and get a random int
# If we were appending it would be li.append((randint, name))
# list of tuples [ (100, 'bob'), (88, 'tom') .....]
names = [(randint(0,100), l.split(',')[0]) for l in open('people.csv').read().split('\n') if l != '']
names.sort()
print('Lowest 10:')
[print(n) for n in names[:10]]
names.sort(reverse=True)
print('Top 10:')
[print(n) for n in names[:10]]