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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, Jadaflournoy5
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
image
Computers and Technology, 23.06.2019 03:00, SKYBLUE1015
What are the different parts of computer
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, Siris420
Plz ( which is an example of a good url?
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, FlowerChild1229
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
You know the right answer?
4.23 lab: structured phonebook while playing around with his new phone, kenneth found out that it c...

Questions in other subjects: