1import csv
2
3input_file = csv.DictReader(open("people.csv"))
4
5max_age = None
6oldest_person = None
7for row in input_file:
8 age = int(row["age"])
9 if max_age == None or max_age < age:
10 max_age = age
11 oldest_person = row["name"]
12
13if max_age != None:
14 print "The oldest person is %s, who is %d years old." % (oldest_person, max_age)
15else:
16 print "The file does not contain any people."
17