Viewing test scores from one of three CSV files Is there any way I could tidy this code and make it look better and more appealing?

import csv
math_class = input ("Which math class would you like to see the results of?")
while math_class not in ['1','2','3']:
    math_class = input ("Which math class would you like to see the results of?")
sort = input ("How would you like to sort the results alphabetical, highest or average:\n")
while sort not in ["alphabetical","highest","average"]:
    sort = input ("How would you like to sort the results")
class_file_names = ['Class 1.csv', 'Class 2.csv', 'Class 3.csv']
scan = open(class_file_names[int(math_class)-1], 'r+')
rows = csv.reader(scan)
data = []
next(scan)

for row in rows:
    data.append(row)
scan.close()

if(sort == "alphabetical"):
    word = "- Highest Score on test:"
    sorted_= sorted(data, key=lambda name: name [0])
    field = 5

if(sort == "average"):
    word = "- Average Score"
    sorted_ = sorted(data, key=lambda average: average[4], reverse=True)
    field = 4

if(sort == "highest"):
    word = "- Highest Score on test:"
    sorted_ = sorted(data, key=lambda total: total[5], reverse=True)
    field = 5

for row in sorted_:
    print(str(row[0]), word, str(row[field]))
input ("Sort Complete, press any key to close the program.")


If there is no way I could clean up the code, then that's fine as it does what I want it to (it's just that I thought the code could look more appealing than it already is).
If you see a whole bunch of if/else statements with the only difference being some function, take advantage of the fact that functions are first class objects in python. For instance, you could create a dictionary that maps your sort options to sorting functions; while you're at it, explore the built ins (such as operator) as well:

from operator import itemgetter

sort_options = {
    # itemgetter(0) is equivalent to lambda x: x[0]
    # &gt;&gt;&gt; x = [1, 2, 3]
    # &gt;&gt;&gt; f = itemgetter(0)
    # &gt;&gt;&gt; g = itemgetter(1)
    # &gt;&gt;&gt; f(x)
    # 1
    # &gt;&gt;&gt; g(x)
    # 2
    # sort_option: (key_of_sort, your_word, sort_in_reverse?, your_field)
    'alphabetical': (itemgetter(0), "- Highest Score on test:", False, 5),
    'average': (itemgetter(4), "- Average Score", True, 4),
    'highest': (itemgetter(5), "- Highest Score on test:", True, 5),
}

def custom_sort(data, sort):
    fn, word, rev, field = sort_options[sort]
    sorted_ = sorted(data, key=fn, reverse=rev)
    return word, sorted_, field

word, sorted_, field = custom_sort(data, sort)