1def query(id):
2 for line in file:
3 table = {}
4 (table["ID"],table["name"],table["city"]) = line.split(";")
5 if id == int(table["ID"]):
6 file.close()
7 return table
8 # ID not found; close file and return empty dict
9 file.close()
10 return {}
11