subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:00
Ramon is graphing the function  f(x) = 3(4)x. he begins by plotting the initial value. which graph represents his initial step?
Answers: 2
question
Computers and Technology, 22.06.2019 11:50
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
question
Computers and Technology, 23.06.2019 22:20
Learning sign language is an example of a(n) learning sign language is an example of a(n)
Answers: 2
You know the right answer?
4.23 lab: structured phonebook while playing around with his new phone, kenneth found out that it c...
Questions
question
Mathematics, 08.03.2021 21:50
question
Mathematics, 08.03.2021 21:50
question
Spanish, 08.03.2021 21:50
question
Mathematics, 08.03.2021 21:50