Computers and Technology

4.23 lab: structured phonebook while playing around with his new phone, kenneth found out that it can store more information about his friends than only their phone numbers. after adding some more information to it, he ended up with the following phonebook: name phone biggest fear maegan 1 major neuroscience caio grading comp. sci. bruce 3 bats however, after he was done he couldn't remember how to retrieve this information and needs your ! to achieve this, you need to: • create a dictionary with all the information above;
• prompt the user for the name of a friend • if the name is not one of kenneth's friends, print an error out. for instance, if name==clark, you should print: no friend named clark.
• next, take as input the piece of information the user wants, only if the name is of one of his friends;
• if the required information exists for the given friend, print it out. for instance, if name==maegan and information==phone, you should print: maegan's phone is 1.
• else, if the information does not exist, print an error out. for instance, if name==bruce and information==major, you should print: no major for bruce. hint: use a dictionary of dictionaries -> data['maegan']['major'] == 'neuroscience'.
hint: to print out a single quote you can do either print(" ") or print(' \ ').

example 1 (friend is listed and information exists): if the input is: caio biggest fear the output should be: caio's biggest fear is grading.
example 2 (friend is listed but information doesn't exist): if the input is: bruce nickname the output should be: no nickname for bruce.
example 3 (friend isn't listed): if the input is: clark kent the output should be: no friend named clark kent.

important: notice that we do not have a second input if the friend isn't known! lab activity 4.23.1: lab: structured phonebook 0/30 main. py

answer
Answers: 1

Similar questions

Do you know the correct answer?
4.23 lab: structured phonebook while playing around with his new phone, kenneth found out that it c...

Questions in other subjects:

Konu
Social Studies, 18.03.2021 03:30
Konu
Engineering, 18.03.2021 03:30