Question: Python coding please, and make two functions dont use input or import or print and please explain the steps Building the Dictionary Write a function

 Python coding please, and make two functions dont use input or

Python coding please, and make two functions dont use input or import or print

and please explain the steps

Building the Dictionary Write a function named create.dict, that takes one parameter, an open file handle (remember ex5, this is an open file handle, not the name of a file), and returns a dictionary that maps a string to a list of strings and ints. In particular, the type contract of this function will be: (io.TextIOWrapper) -> dict of str [str, str, str, int, str] This function will read a file formatted like the provided ex7 data.txt. That is, each le w have a username, first name, last name, age, gender (either M, F or X) and an e-mail address, all separated by spaces. The function will insert each person's information into a dictionary with their username as the key and the value being a list of last name, first name, e-mail, age, gender]. When the entie file has been processed, it will then return the dictionary. Changing the Dictionary Write a function called update.field, that takes 4 parameters: A dictionary in the format created by the previous function, a username, the name of a field1 (One of: LAST', 'FIRST', 'E-MAIL' AGE' or GENDER 2), and a new value to replace the current value of the specified field. The function should not return anything, but instead mutate the dictionary as appropriate. An example call of the function is below: my-dict sclause':'Clause',Santa', 'santa0christmas.np', 450, '' update.field (my_dict, 'sclause', 'AGE', 999) my-dict'sclause' ['Clause', 'Santa', 'santa@christmas.np', 999, M' True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!