CSCA08H3 Lecture Notes - Lecture 8: Result Set
Document Summary
Field_dict = {"last": 0, "first": 1, "e-mail": 2, "age": 3, "gender": 4} def create_dict(rfile): """(io. textiowrapper) -> dict of {str: [str, str, str, int, str]} """(dict, str, str, str or int) -> none. >>> my_dict = {"sclause":["clause", "santa", "santa@chri. np", 450, "m"]} >>> my_dict == {"sclause": ["clause", "santa", "santa@chri. np", 999, "m"]} # the internal comment also included if username in my_dict. keys(): my_dict[username][field_dict[field]] = new_value def select(my_dict, field, check_field, value): """(dict, str, str, str or int) -> set. >>> my_dict = {"sclause":["clause", "santa", "sa@ch. np", 450, "m"]} >>> my_dict["ebunny"] = ["bunny", "easter", "bunny@e. hop", 99, "m"] >>> my_dict["tfairy"] = ["fairy", "tooth", "fairy@money4teeth. net", 0, "f"] >>> select(my_dict, "e-mail", "gender", "m") == {"sa@ch. np", "bunny@e. hop"}