Menu

(Solved) : 515 Lab Many Friends Help Kenneth Able Organize Friends Information Phonebook Part Phonebo Q37893160 . . .

Plz help!!!

Python!!!

5.15 LAB: Too Many Friends After all your help Kenneth was able to organize all his friends information in his phonebook. A4. print all the information for the given friend, following the format below: Data available for Barry: major -> forensics hThen the output should be: Enter a name: ERROR: unknown name. Enter a name: Data available for Caio: biggest fear-grading maj

5.15 LAB: Too Many Friends After all your help Kenneth was able to organize all his friends’ information in his phonebook. A part of the phonebook is shown below as an example hobby Name phone biggest fearmajor Maegan neuroscience fifa fighting crime working: Mexican “drinks” Caio Bruce Jared Hans grading comp. sci bats CS lecturing Shengquan 3120 Vivian data science forensics Barry running However, he has too many friends and it takes some time to find the one he is trying to find. Your mission, should you choose to accept it, is to create a function to retrieve all the data for a single friend. To achieve this, you shoud: 1. create a function print_data that receives one phonebook as parameter 2. prompt the user for a name, using this message: Enter a name: 3. if the name is not in the phonebook, you should print the error message below and ask for a new name just like in step 2. ERROR: unknown name. 4. print all the information for the given friend, following the format below: Data available for Barry: major -> forensics hobby -> running HINT the provided phonebooks to your function are dictionaries of dictionaries, as previously used in zyLab 4.22 Structured Phonebook. For instance, phonebook[BarryThobby] = “running” for the given example Example 1: If the dictionary you receive is the one that corresponds to the table above, and the input is: Jared Then the output should be Enter a name: Data available for Jared: major -> cs hobby -> working : ( Example 2: If the dictionary you receive is the one that corresponds to the table above, and the input is: Ciao Caio Then the output should be Enter a name: ERROR: unknown name. Enter a name: Data available for Caio: Then the output should be: Enter a name: ERROR: unknown name. Enter a name: Data available for Caio: biggest fear-grading major-comp. sci. hobby -> fifa LAB ACTIVITY 5.15.1: LAB: Too Many Friends 0/5 main.py Load default template.. 1 # CREATE YOUR FUNCTION HERE 4 # DON” T CHANGE THIS CODE! 5 # IT IS USED FOR THE FIRST TWO TEST CASES 6 if namemain”: 7 example ‘Maegan’:phone: ‘1’, ‘major neuroscience’, Caio: ‘biggest fear’: ‘grading, ‘majorcomp. sci.’, ‘hobby:’fifa’, Bruce’: ‘phone’: ‘3, biggest fear bats’, ‘hobby”: ‘Fighting crime’, Jared’: ‘major’hobby working:C Hans’:’biggest fear’: ‘lecturing, ‘hobby ‘Mexican “drinks ‘, Shengquan ‘phone 3120′, Vivian’: ‘major ‘data science Barry’: ‘major forensics’, ‘hobby running’ 9 10 12 13 14 15 16 print dataCexample) Run your program as often as you’d like, before submitting for grading. Below,type any needed input values in the first box, then click Run program and observe the program’s output in the second box. Develop mode Show transcribed image text

Expert Answer


Answer to 515 Lab Many Friends Help Kenneth Able Organize Friends Information Phonebook Part Phonebo Q37893160 . . .

OR