python Programming Glossary: sunspot_dict
Create a function that opens a file and creates a dictionary http://stackoverflow.com/questions/8117441/create-a-function-that-opens-a-file-and-creates-a-dictionary Everything I do must work with the main program. def main sunspot_dict file_str raw_input Open what data file keep_going True while.. True while keep_going try init_dictionary file_str sunspot_dict except IOError print Data file error try again file_str raw_input.. what data file continue print Jan 1900 1905 avg_sunspot sunspot_dict 1900 1905 1 1 print Jan June 2000 2011 avg_sunspot sunspot_dict..
|