1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stiv31 [10]
2 years ago
7

Use a for/else loop to traverse through the key names in the dictionary below in order to find Mr. Potatohead’s mailing address.

The key name is his social security number. Once you find his SSN (key-name), you can display its value by using the following function:
print (Dictary.get(123-45-6789))

If the key you are looking for does not exist, your code should break out of the loop and display the following message: “Key not found”

Dictary = {
'code':6734,
'dept': 'sales',
123-45-6789:"Mr.Potato Head \n234 Potato Lane \nPotato Chip, ID 77725"
}
Computers and Technology
1 answer:
Tatiana [17]2 years ago
4 0

Dictary = {

'code':6734,

'dept': 'sales',

123-45-6789:"Mr.Potato Head \n234 Potato Lane \nPotato Chip, ID 77725"

}

for i in Dictary.keys():

   if i == 123-45-6789:

       print(Dictary.get(i))

       break

else:

   print("Key not found")

You can further test this code by deleting Mr.Potato head's info from the dictionary. I hope this helps!

You might be interested in
The first and second numbers in the Fibonacci sequence are both 1. After that, each subsequent number is the sum of the two prec
vlabodo [156]

Answer:

In Python:

def fib(nterms):

   n1, n2 = 1, 1

   count = 0

   while count < nterms:

       term = n1

       nth = n1 + n2

       n1 = n2

       n2 = nth

       count += 1

   return term

Explanation:

This line defines the function

def fib(nterms):

This line initializes the first and second terms to 1

   n1, n2 = 1, 1

This line initializes the Fibonacci count to 0

   count = 0

The following while loops gets the number at the position of nterms

<em>   while count < nterms: </em>

<em>        term = n1 </em>

<em>        nth = n1 + n2 </em>

<em>        n1 = n2 </em>

<em>        n2 = nth </em>

<em>        count += 1 </em>

This returns the Fibonnaci term

   return term

7 0
3 years ago
With an example in each, describe the use of two basic functions which are known by the "string.h" header file.
olga nikolaevna [1]

Answer:

strcmp(char * A, char * B);

strcat(char * A, char * B)

Explanation:

One of these basic functions is the function strcmp(char * A, char * B).

This functions compares if two strings are equal; If they are, it returns 0. If not, it returns 1;

So, an example:

char A[13] = "Buffalo Bills";

char B[13] = "Buffalo Bills";

if (strcmp(A,B) == 0)

printf("The strings are the same\n);

else

printf("The strings are not the same");

In this case, they are the same.

----------------------

If for example:

char B[13] = "Buffalo Billz"

It would fall in the else, A and B would not be the same strings.

--------------------------

Other function is the strcat(char * A, char * B);

This function takes two strings as an input, and concatenate them to the first.

For example:

char A[15] = "Buffalo";

char B[5] = "Bills";

strcat(A, B);

printf("%s\n", A);

The output is:

Buffalo Bills

5 0
3 years ago
QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
IgorLugansk [536]

Answer:

yes cuz 25x8=200

Explanation:

3 0
3 years ago
Read 2 more answers
Discuss copyright issues as they relate to the Internet, including software piracy and digital rights management, and the Digita
LUCKY_DIMON [66]

To avoid privacy these copyright is been implemented. If copyright is not implemented software company such as Microsoft, Google cannot run the organization so that software has copyright and licenses and they protect from software privacy.

<u>Explanation:</u>

Since the world is digital world all software are available in internet for download and end user will not pay for software and use the software without purchasing from software development industries.

Even software are protected with key, hacker write the tool to brakes the key, so end user easily use these tools and generate the key and user it.

So that software company use Digital millennium copyright act, so that end user can arrested for missing the software’s.

5 0
3 years ago
which of the following is not a name of one of the central features of Facebook timeline activity log Graph Search for Daily New
Pani-rosa [81]
The correct answer is Graph Search for Daily News

This does not exist on Facebook, unlike the timeline and the activity log.
3 0
3 years ago
Other questions:
  • Computer hardware had been designed to run a single operating system and a single app, leaving computers vastly underutilized. o
    15·1 answer
  • WILL GIVE BRAINLIEST TO FIRST AND BEST ANSWER!
    10·1 answer
  • What is the name of the contextual or specific tab that appears in page layout view when adding a header
    15·1 answer
  • Please answer this correctly what’s the answer opening modify style dialog box enables you to
    8·1 answer
  • Which of these is an online presentation tool?
    9·2 answers
  • Which option is referred to by the Reports Due tag?
    7·1 answer
  • What is the use of technology to enable people to learn anytime and anywhere​
    13·1 answer
  • In science class, Patricia is giving a presentation on the different types of flowers in her community. As part of her presentat
    5·1 answer
  • Help me guys plssssss​
    10·1 answer
  • WHAT ARE THE USES OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!