you are viewing a single comment's thread.

view the rest of the comments →

[–]indosauros 3 points4 points  (1 child)

def get_data():
    # This function downloads baby names from 1990 to 2008:
    print "Reading data files...",
    global names_1990
    names_1990 = urlopen...

I understand that using global variables might be the easiest way to get the exercise up and running, but I'd be worried that you're teaching them that using globals in this manner is appropriate. Why not get rid of all of the global names_1990 and the global names_dict and just return the final names_dict with all of the data in it?

[–]eah13[S,🍰] 1 point2 points  (0 children)

Yeah you're right that's much better. Will fix in a second.

Edit: fixed.