LAB: Contact list A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Assume that the list will always contain less than 20 word pairs. Ex: If the input is: 3 Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309

Answers

Answer 1

Answer:

The program in Python is as follows:

n = int(input(""))

numList = []

for i in range(n):

   word_pair = input("")

   numList.append(word_pair)

name = input("")

for i in range(n):

   if name.lower() in numList[i].lower():

       phone = numList[i].split(" ")

       print(phone[1])

   

Explanation:

This gets the number of the list, n

n = int(input(""))

This initializes list

numList = []

This iterates through n

for i in range(n):

This gets each word pair

   word_pair = input("")

This appends each word pair to the list

   numList.append(word_pair)

This gets a name to search from the user

name = input("")

This iterates through n

for i in range(n):

If the name exists in the list

   if name.lower() in numList[i].lower():

This gets the phone number associated to that name

       phone = numList[i].split(" ")

This prints the phone number

       print(phone[1])


Related Questions

Design a Python3 function to compare every prefix of a string X to every element of string Y, if there is a match, place it in a python set, sort and reversely sort the set, and return the sorted and reversely sorted sets.

Answers

Answer:

The function is as follows:

def compare_prefix(strX,strY):    

   prefix=set()

   for i in range(len(strX)):

       for j in range(i+1,len(strX)):

           chk =strX[i:j+1]

           if chk in strY:

               prefix.add(chk)

   

   sort_prefix = sorted(prefix)

   rev_sort_prefix = sorted(prefix,reverse=True)

   return(sort_prefix,rev_sort_prefix)

Explanation:

This defines the function

def compare_prefix(strX,strY):    

This creates an empty set, prefix

   prefix=set()

This iterates through each character in strX

   for i in range(len(strX)):

This iterates through every other character in strX

       for j in range(i+1,len(strX)):

This gets the prefix of strX by concatenating strings from i to j + 1

           chk =strX[i:j+1]

This checks if the prefix is in strY

           if chk in strY:

If yes, the string is added to set prefix

               prefix.add(chk)

   

This sorts prefix

   sort_prefix = sorted(prefix)

This reverses the sorted prefix

   rev_sort_prefix = sorted(prefix,reverse=True)

This returns the sorted and reversed prefix

   return(sort_prefix,rev_sort_prefix)

A line beginning with a # will be transmitted to the programmer’s social media feed.

A.
True

B.
False

Answers

Answer:

True?

Explanation:

Answer:

The answer is false.

Explanation:

A “#” doesn’t do that in Python.

Which statement best describes Link State routing? Group of answer choices Each router builds a cost-weighted graph of the network of all the routers and the shortest links between them, based on information received from each router regarding only its nearest neighbors All of these Each router uses a HELLO packet to announce its presence to its neighbors Each router builds a table with the best distance between each router and the link to use, based on each router’s providing data on distances to all the routers in its routing table to its nearest neighbors

Answers

Answer:

Each router builds a cost-weighted graph of the network of all the routers and the shortest links between them, based on information received from each router regarding only its nearest neighbors.

Explanation:

A routing protocol can be defined as a set of defined rules or algorithms used by routers to determine the communication paths unto which data should be exchanged between the source router and destination or host device.

Additionally, in order for packets to be sent to a remote destination, these three parameters must be configured on a host.

I. Default gateway

II. IP address

III. Subnet mask

After a router successfully determines the destination network, the router checks the routing table for the resulting destination network number. If a match is found, the interface associated with the network number receives the packets. Else, the default gateway configured is used. Also, If there is no default gateway, the packet is dropped.

Basically, there are two (2) main categories of routing protocols used in packet switching networks and these includes;

1. Distance-vector routing.

2. Link state routing.

Link state routing refers to a complex routing technique in which each router learns about it's own neighborhood or directly connected networks (links) and shares the information with every other router present in the network.

Hence, the statement which best describes Link State routing is that, each router builds a cost-weighted graph of the network of all the routers and the shortest links between them, based on information received from each router regarding only its nearest neighbors. Some examples are intermediate system to intermediate system (IS-IS) and open shortest path first (OSPF).

Research and build a chroot jail that isolates ssh users who belong to the restrictssh group. (You will also need to create the restrictssh group). Next, install an ftp server and configure it to allow anonymous logins. Create a second chroot jail that can be accessed by the anonymous account. You will probably need to create several new user accounts to facilitate testing your setups.

Answers

Answer:

Explanation:

#!/bin/bash

# This script can be used to create simple chroot environment

# Written by LinuxConfig.org  

# (c) 2020 LinuxConfig under GNU GPL v3.0+

#!/bin/bash

CHROOT='/var/chroot'

mkdir $CHROOT

for i in $( ldd $* | grep -v dynamic | cut -d " " -f 3 | sed 's/://' | sort | uniq )

 do

   cp --parents $i $CHROOT

 done

# ARCH amd64

if [ -f /lib64/ld-linux-x86-64.so.2 ]; then

  cp --parents /lib64/ld-linux-x86-64.so.2 /$CHROOT

fi

# ARCH i386

if [ -f  /lib/ld-linux.so.2 ]; then

  cp --parents /lib/ld-linux.so.2 /$CHROOT

fi

echo "Chroot jail is ready. To access it execute: chroot $CHROOT"

Theo is working on data for his business using Design view in an Access form. He wants to change a text field box's
number of products sold from 10,789 to 10,790. In which section of the form should Theo to make this change?
form footer
O form detail
form data
form header

Answers

Answer: the answer si b . form detail

Explanation

Answer:

the answer is b . form detail

Explanation:

8. Many organizations build their networks around this type of computer.
A) server
B) terminal
C) supercomputer
heir netwo
of multiple
or that stores data
A)dektop

Answers

it is B) terminal bc There are several different types of computer networks. Computer networks can be characterized by their size as well as their purpose

B is the answer because I looked it up

There used to be a popular type of pulp book for younger readers. They were called "Choose Your Own Adventure" novels. The idea was pretty simple. You'd start reading and then a few pages into the book, there would be a plot development that required a choice. The book might describe that you've entered a spooky house and the door has locked behind you. It would then ask you if you want to try to exit by going through the kitchen or exploring upstairs. If you chose to go into the kitchen, you'd turn to page 200, if you chose to go upstairs, you'd turn to page 43. This would repeat maybe five or six times though the book. You could re-read it a few times and try different outcomes.
In this lab you are going to create a choose your own adventure application using navigation controllers. The introduction screen to your application will contain a few lines of text to set up a story and then leave the user with a choice. Below the text, you will present two buttons that correspond to the different choices.
For example, you might see the following text on the main screen:
You are walking down the street when a tiger runs up and takes your lunch and then runs away...
Do you want to chase the tiger or run away?
Chase
Run Away
The user must then tap one of the buttons. This will move the user to a new screen with a few more lines of the story and another choice and two more buttons. You will create three (3) turning points in your story. This means that your story will have eight (8) different possible outcomes and a total of 15 screens.
Requirements
The story must ask three (3) questions, no matter how the user answers the previous question. All the questions must be different and result in a different story text.
The story must have eight (8) possible different final outcomes.
The story must include a minimum of 15 screens in total.
Create content that is appropriate and not-offensive. We will share these and play them together.
For extra credit you can add an extra screen and use inputs to capture data from the user such as a name, favorite food, or lucky number and use this data in the story.

Answers

Answer:

click on the link

Explanation:

link is somewhere hidden

Which tab should you click if you want to access the Show All Comments option in a worksheet?

Home
Page Layout
Review
View

Answers

Answer: Review

Because you want to review the comments

Answer:

C.) Reivew

Explanation:

Doing it on EDG now!

Best luck to yall :3

Have a good day and byee

NEED HELP IMMEDIATELY!!
Highlight the upsides and downsides of seeking online help for a technical problems.

Answers

Answer:

Pros: Experts are there to help, Help can be found almost 24 hours of the day so you don't have to wait for an expert to be available, easier to ask more in detail.

Cons: Answers may not always come quickly, there is no face to face interaction so you dont know how legit the person is, some advice may be incorrect or old.

Explanation:

layers allow you to work with one element of an image without disturbing the others true or false​

Answers

I think it is True not sure but try it

One way to add a table to a presentation is to click on Clip Art under the Insert tab. click on WordArt under the Insert tab. right-click on an existing page with content and choose Add Table. add a new slide and left-click on the Table symbol in an empty area.

Answers

Huh? What is this? …..

list the main industries in Sierra Leone​

Answers

Answer:

The main industries in Sierra Leone are: Diamond mining

Petroleum refining

Small - scale manufacturing (beverage, textiles,footwear)

Explanation:

They also engage in commercial ship repair

Which of the following is the cause of transmission impairment?
Select one:
O Frequency
O Amplitude
O Attenuation
O Phase​

Answers

Answer:

attenuation is the third one

A new school is being built in the local school district. It will have three computer labs with 28 computers each. There will be 58 classrooms with 2 computers each that need to be on one sub-subnet. The office staff and administrators will need 7 computers. The guidance and attendance office will have 5 computers. The school has been given the address 223.145.75.0/24.

Complete the information required below.

Subnet Subnet Mask (/X) Subnet Address First Usable Host Last Usable Host Broadcast Address
1

2

3

4

5

6

7

8

9

10

Answers

Answer:

The table is formed as attached figure.

Explanation:

Subnets can use specific number of hosts so /25 can host 128 hosts, reducing by a factor of 2 leading to /30 as with only 4 hosts. Thus the subnets are alloted as indicated in the attached image.

help meeeee pleaaaseee ​

Answers

Answer:

just drop out that the easiest solution

Write a Perl program that uses a hash and a large number of operations on the hash. For example, the hash could store people’s names and their ages. A random- number generator could be used to create three- character names and ages, which could be added to the hash. When a duplicate name was generated, it would cause an access to the hash but not add a new element. Rewrite the same program without using hashes. Compare the execution efficiency of the two. Compare the ease of programming and readability of the two.

Answers

Answer:

The Perl code is attached in the attachment. The execution time for using hashes is 0 seconds while that for without hash is 27 seconds.

Explanation:

In terms of ease of access and readability, both approaches are similar. However, it is evident from the time of execution that the with hashes is more efficient than the value of without hashes. This indicates that using hashes is more efficient.

How are status reports useful

Answers

Answer:

Project managers use status reports to keep stakeholders informed of progress and monitor costs, risks, time and work. Project status reports allow project managers and stakeholders to visualize project data through charts and graphs.

Which keyboard shortcut do we use to turn on APC?​

Answers

Answer:

ctrl p I gusse hop it helps

bye know have a great day

Explanation:

what connect webpages?​

Answers

Anchor tags or hyperlinks are used to connect webpages.

Answer:

"Hypertext links are those words that take you from one web page to another when you click them with your mouse. Although the same HTML tag you study in this hour is also used to make graphical images into clickable links, graphical links aren't explicitly discussed here" I got this from https://www.informit.com/articles/article.aspx?p=440289 sorry I couldnt take the time myself here to help :(

Explanation:

What is the hamming distance between the following bits? Sent
bits: 101100111, Received bits: 100111001
Select one: 5. Or 3 or 6 or4​

Answers

I think

the hamming distance between the following bits its 5

A new school is being built in the local school district.It will have three computer labs with 28 computers each. There will be 58 classrooms with 2 computers each that need to be on one sub-subnet.The office staff and administrators will need 7 computers. The guidance and attendance office will have 5 computers. The school has been given the address 223.145.75.0/24. Subnets are assigned from largest to smallest. Everything is based on the number of usable hosts.
Complete the information required below.
Subnet Subnet Mask (/X) Subnet First Usable Last Usable Broadcast
Address Host Host Address
1
2
3
4
5
6
7

Answers

Answer:

Following are the responses to the given question:

Explanation:

The subnet mask /25 could be the host 128 hosts.

The subnet mask /26 could be the host 64 hosts.

The subnet mask /27 could be the host 32hosts.

The subnet mask /28 could be the host 16 hosts.

The subnet mask /29 could be the host 8 hosts.

The subnet mask /30 could be the host 4 hosts.

It is based on the requirement in which I have been using /25,/27,/28,/29 subnet masks on the basis of the usable slots.

What is the function of a bread crumb trial in a website

Answers

Answer:

A “breadcrumb” (or “breadcrumb trail”) is a type of secondary navigation scheme that reveals the user's location in a website or Web application. The term comes from the Hansel and Gretel fairy tale in which the two title children drop breadcrumbs to form a trail back to their home.

Explanation:

A breadcrumb or breadcrumb trail is a graphical control element frequently used as a navigational aid in user interfaces and on web pages. It allows users to keep track and maintain awareness of their locations within programs, documents, or websites. Breadcrumbs make it easier for users to navigate a website – and they encourage users to browse other sections of the site. ... You head to their site and end up on The Nestle company history page. Using their breadcrumbs, you can easily navigate back to About Us, History, or even their home page.

the shadows she fancied has tricked her. what does that mean

Answers

Answer: the room had been dark, she had not been able to see him clearly

Explanation:

The word FANCIED means desire or  fancied would mean supposed, believed, or imagined.

So it means that she might think that the shadow (assuming the shadow was a person who was invisible) was just her imagination or hallucination but in reality, the shadow (invisible person) tricked her.

_________________

Brainliest would be greatly appreciated!

_________________

#SpreadTheLove

#SaveTheTrees

- Mitsu JK

You want a cable that could be used as a bus segment for your office network. The cable should also be able to support up to 100 devices. Which cable should you use?

A.
RG-6
B.
RG-8
C.
RG-58U
D.
RG-59

Answers

Answer: C

Explanation:

True or false question :)

Handware can be tracked back to ancient times. Over six centuries ago.
°true
°false

Answers

Answer:

false and it's a recent technology

i would say the answer is false!

SMTP (Simple Mail Transfer Protocol) is the standard protocol for transferring mail between hosts over TCP. A TCP connection is set up between a user agent and a server program. The server listens on TCP port 25 for incoming connection requests. The user end of the connection is on a TCP port number above 1023. Suppose you wish to build a packet filter rule set allowing inbound and outbound SMTP traffic. You generate the following rule set:

Rule Direction Src Addr Dest Addr Protocol Dest Port Action
A In External Internal TCP 25 Permit
B Out Internal External TCP >1023 Permit
C Out Internal External TCP 25 Permit
D In External Internal TCP >1023 Permit
E Either Any Any Any Any Deny

Required:
Describe the effect of each rule.

Answers

Answer:

The five rules are described as follows:

Rule A permits the inbound Simple Mail Transfer Protocol (SMTP) connection.

Rule B permits the inbound Simple Mail Transfer Protocol (SMTP) connection.

Rule C permits the outbound Simple Mail Transfer Protocol (SMTP) connection.

Rule D permits the outbound Simple Mail Transfer Protocol (SMTP) connection.

Rule E does not perform any action. Thus it is when the action is denied.

Explanation:

Rule A allows information transfer of the incoming email from the external server to the internal remote server, thus this allows an inbound connection.

Rule B allows information transfer of the incoming email from the remote server to the external remote server, thus this allows an inbound connection.

Rule C allows information transfer of outgoing email from the external server to the internal remote server, thus this allows an outbound connection.

Rule D allows information transfer of the outgoing email from the remote server to the external remote server, thus this allows an outbound connection.

Rule E does not allow any action in either direction thus it is when action is denied.

How to make a project using PID and thermacouple

Answers

Explanation:

Required tools and components:

Soldering iron

Solder

Flux pen

Fine gauge solder (23 gauge or finer)

Wire cutter

MAX31855 thermocouple interface chip (available directly from Maxim Integrated)

Thermocouple with junction suitable for your application (e.g., probe, washer, etc.)

J-type (-40°C to +750°C)

K-type (-200°C to +1350°C)

T-type (-200°C to +350°C) Solid state relay (will depend on your application)

USB FTDI 5V cable (Note: A single cable can be used for many different microcontroller projects)

Computer with Arduino IDE v1.0

Wall-wart 9V/1.5A, 2.1mm center positive

Your systems analysis team is close to completing a system for Azuka Theatre. Kevin is quite con- fident that the programs he has written for Azuka's inventory system used for keeping track of stage scenery and props will perform as required because they are similar to programs he has done before. Your team has been very busy and would ideally like to begin full systems testing as soon as possible. Mark and Allison, two of your junior team members have proposed the following:
a. Skip desk checking of the programs (because similar programs were checked in other installa- tions; Kevin has agreed).
b. Do link testing with large amounts of data to prove that the system will work.
c. Do full systems testing with large amounts of live data to show that the system is working. Respond to each of the three steps in their proposed test schedule. Use a paragraph to explain your response.

Answers

Answer:

a

Explanation:

im smart

Desk checking is a method to check the logic of an algorithm by manually working through it. There are many reasons for Desk Checking that may be omitted or simplified.

What are the reasons for desk checking?

If the current program’s logic is identical, then this step may be omitted; this, however, implies some effort to verify “sameness.” If truly identical, perhaps there is re-usable code, or the code to be developed should become a reusable library routine.

Link testing is the testing of the group of modules in order to ensure that the modules operate correctly in combination. It generally verifies that the function or operation is executed properly. System testing is a type of testing that is used to confirm the actual function of the system in which a work is executed or performed.

Therefore, all of the testing mechanisms are well described above.

To learn more about System and link testings, refer to the link:

https://brainly.com/question/7658665

#SPJ2

The following code segment appears in a class other than Backyard. It is intended to print true if b1 and b2 have the same lengths and widths, and to print false otherwise. Assume that x, y, j, and k are properly declared and initialized variables of type int.

Backyard b1 = new Backyard(x, y);
Backyard b2 = new Backyard(j, k);
System.out.println( /* missing code */ );

Which of the following can be used as a replacement for /* missing code */ so the code segment works as intended?

a. b1 == b2
b. b1.equals(b2)
c. equals(b1, b2)
d. b1.equals(b2.getLength(), b2.getWidth())
e. b1.length == b2.length && b1.width == b2.width

Answers

Answer:

b. b1.equals(b2)

Explanation:

The question has a missing source file (which can be found online).

The function that compares b1 and b2 is:

public boolean equals(Object other) {

if (other == null) {

return false; }

Backyard b = (Backyard) object;

return (length == b.getLength() && width == b.getWidth());

}

Using the function definition, we have:

equals(Object other)

This implies that, the first object will be compared to the second, using the function name.

i,e,

b1.equals(b2)

Hence (b) is correct

In this exercise we have to use the knowledge in computational language in C++ to describe a code that best suits, so we have:

The code can be found in the attached image.

To make it simpler we can write this code as:

public boolean equals(Object other) {

if (other == null) {

return false; }

Backyard b = (Backyard) object;

return (length == b.getLength() && width == b.getWidth());

}

This program will result in the following missing variable:

b1.equals(b2)

See more about C++ at brainly.com/question/19705654

Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty. The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String [] salsa = {"Mild","Medium","Sweet","Hot","Zesty"};

 int [] number = new int[5];

 for(int i = 0;i<5;i++){

     System.out.print(salsa[i]+" number: ");

     number[i] = input.nextInt();

 }

 for(int i = 0;i<5;i++){

     System.out.println(salsa[i]+" : "+number[i]);

 }

 int smallest = number[0];  int highest = number[0];

 int count = 0;

 for(int i = 0;i<5;i++){

     if(smallest > number[i]){

         smallest = number[i];

         count = i;

     }

 }

 System.out.println("Smallest");

 System.out.println(salsa[count]+" : "+smallest);

    for(int i = 0;i<5;i++){

     if(highest < number[i]){

         highest = number[i];

         count = i;

     }

 }

 System.out.println("Highest");

 System.out.println(salsa[count]+" : "+highest);

}

}

Explanation:

This initializes the salsa names

 String [] salsa = {"Mild","Medium","Sweet","Hot","Zesty"};

This declares the array for the amount of salsa

 int [] number = new int[5];

This iterates through the 5 salsas and get input for the amount of each

 for(int i = 0;i<5;i++){

     System.out.print(salsa[i]+" number: ");

     number[i] = input.nextInt();

 }

This prints each salsa and the amount sold

 for(int i = 0;i<5;i++){

     System.out.println(salsa[i]+" : "+number[i]);

 }

This initializes smallest and largest to the first array element

 int smallest = number[0];  int highest = number[0];

This initializes the index of the highest or lowest to 0

 int count = 0;

The following iteration gets the smallest of the array elements

 for(int i = 0;i<5;i++){

     if(smallest > number[i]){

         smallest = number[i];

This gets the index of the smallest

         count = i;

     }

 }

This prints the smallest

 System.out.println("Smallest");

 System.out.println(salsa[count]+" : "+smallest);

The following iteration gets the largest of the array elements    

for(int i = 0;i<5;i++){

     if(highest < number[i]){

         highest = number[i];

This gets the index of the highest

         count = i;

     }

 }

This prints the highest

 System.out.println("Highest");

 System.out.println(salsa[count]+" : "+highest);

Other Questions
What treaty ended the Texas Revolution Identify the terminal point for a 60 angle in a unit circle.A.22B. (1,1)c. (7)D. (5.) Which sentence would NOT go in a concise advertisement? brainly if correctA) My dog, Patches, is lost.B) Patches is black and white.C) She has a red collar.D) Patches is a good swimmer. Siri, who is driving her automobile, is injured when another driver negligently causes an automobile accident. Siri hires a lawyer to represent her on a 35 percent contingency-fee basis. If the lawyer wins the case for Siri or settles the case with Siri's approval, he will earn 35 percent of whatever is collected from the defendant. If the lawyer does not win or settle the lawsuit, he gets paid nothing. The agent can recover this amount from the principal because of the duty to _______. A car travels at a rate of speed of 45 miles per hour for 12 hours. How far did it travel? Helpppp ! 2) What actions did the government take in the following areas? (a) Controlling inflation:(b) Shrinking supplies:(c) Threat of destructive weapons: The area of a rectangular field is 99m2. The length of one side is11m. The farmer needs to know its perimeter to work out howmuch fencing will be needed? Help PLEASEE HELPPPP QUESTION BELOW PLEASE HELP DUE TODAY HELPPPP 4 This question has two parts. First, answer Part A. Then, answer Part B. Part A In which stanza does the tone of the poem change? A. stanza 4 B. stanza 5 . Stanza 7 D. stanza 9 o Part B Which sentence supports your answer in Part A? A. The number of lines in a stanza changes at that point. B. The rhyme scheme changes at that point. C. The speaker begins to use words that convey sadness. D. The speaker begins to talk of planting the tree.the planting of an apple tree Solve for a.a = 16Enter your answer in the box.a = = How is the judicial branch organized according to the Constitution? Question 10 (1 point) What muscle helps the bladder to contract when the bladder is emptyine? epithelium peritoneum Orugae detrusor If 10^x = 5, then what is x? connie poured 200 milliliters of juice into a glass from a juice carton. She then poured 225 milliliters into a second glass. What is the final change in the volume of the carton? Lillian has 26 counters. Bill has 9 times as many counters as Lillian. How many counters does Bill have? David was thinking of a number. David doubles it and adds 2.9 to get an answer of 13.2. Form an equation with x from the information. Susan is 5 years older than her sister Lucy. The sum of the square of Lucy's age and twice theage of Susan's is 58. How old is Susan? HELP PLEASE HELP PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! what does confederation mean? How can a reader best verify a prediction?by modifying the predictionby rereading a paragraphby continuing to read the textby looking up unknown words in a dictionary