Arrays aren’t the only show in town when it comes to data.
Programming languages come with other data-arranging goodies too, and our chosen tool, Python, is no exception. In this chapter, you’ll associate values with names using a data structure commonly called the hash (better known as dictionary to Python-folk). And when it comes to working with stored data, you’ll read data from an external database system as well as from regular text-based files. All the world’s awash with data, so turn the page and start applying your ever-expanding programming skills to some cool data-processing tasks.
In the previous chapter, you worked out the top three scores, but they’re not much use without the names of the surfers that achieved those scores. There will no be surfing for you until you’ve finished the program.
Here’s the code so far:
scores =  result_f = open("results.txt") for line in result_f: (name, score) = line.split() scores.append(float(score)) result_f.close() scores.sort() scores.reverse() print("The top scores were:") print(scores) print(scores) print(scores)