CSCA08H3 Lecture Notes - Lecture 8: Result Set

74 views1 pages
11 Dec 2017
School
Course

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"}

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents