Computers and Technology, 04.11.2019 22:31, trobbie817
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
Answers: 1
Health, 03.07.2019 18:40, hellokitty1647
Answers: 1
Computers and Technology, 08.11.2019 02:31, nmknightp02
Answers: 2
Health, 17.11.2019 16:31, neariah24
Answers: 2
Health, 21.11.2019 11:31, kritalewis
Answers: 3
4.23 lab: structured phonebook while playing around with his new phone, kenneth found out that it c...
Social Studies, 18.03.2021 03:30
English, 18.03.2021 03:30
Engineering, 18.03.2021 03:30
Geography, 18.03.2021 03:30