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
jarptica [38.1K]
3 years ago
14

What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in

a specific order.) cities = {'GA' : 'Atlanta', 'NY' : 'Albany', 'CA' : 'San Diego'} if 'FL' in cities: del cities['FL'] cities['FL'] = 'Tallahassee' print(cities)
Computers and Technology
1 answer:
iren [92.7K]3 years ago
6 0

Answer:

Nothing will be printed

Explanation:

You can easily find out that FL is not a member of the Dictionary. And we are checking these in the if. Since the if condition ends up being false, the further process will not run as they will only if the condition ends up being true. Hence, nothing will be printed.

Remember, del is used to delete a dictionary item. If this would have been a true condition for if then the FL item in the dictionary would have been deleted as it, in that case, would have been present there. And then the next line would have again added the FL item, and print would have printed the dictionary items with FL item as well. However, since if the condition is ending up being false, nothing will be printed.

If cities['FL'] and print is outside if then

the output will be

{'FL': 'Tallahassee', 'GA': 'Atlanta', 'NY': 'Albany', 'CA': 'San Diego'}

You might be interested in
Define a function typeHistogram that takes an iterator ""it"" (representing a sequence of values of different types) and builds
Alexeev081 [22]

Answer:

def typeHistogram(it,n):

   d = dict()

   for i in it:

       n -=1

       if n>=0:

           if str(type(i).__name__) not in d.keys():

               d.setdefault(type(i).__name__,1)

           else:

               d[str(type(i).__name__)] += 1

       else:

           break

   return list(d.items())

it = iter([1,2,'a','b','c',4,5])

print(typeHistogram(it,7))

Explanation:

  • Create a typeHistogram function that has 2 parameters namely "it" and "n" where "it" is an iterator used to represent a sequence of values of different types while "n" is the total number of elements in the sequence.
  • Initialize an empty dictionary and loop through the iterator "it".
  • Check if n is greater than 0 and current string is not present in the dictionary, then set default type as 1 otherwise increment by 1.
  • At the end return the list of items.
  • Finally initialize the iterator and display the histogram by calling the typeHistogram.
3 0
2 years ago
Qbasic program to accept 10 numbers and to find their sum. <br>​
sesenic [268]

Answer:

the answer is 5

Explanation:

6 0
3 years ago
Question Workspace Check My Work Copying computer software, video games, movies, or music without paying the producer for them i
Tcecarenko [31]

Answer:

Option B, CUSTOMER MISBEHAVIOR.

Explanation:

Consumer misbehavior can defined as the behavioral acts by consumers which violate the generally accepted norms of conduct in consumption situations, and disrupt the order expected in such situations. Misbehavior by consumers disrupts the openness, impersonal trust, and orderliness of the exchange environment.

Some of the examples of customer misbehavior are: shoplifting, bending rules, breaking rules by ignoring warnings and using products in forbidden or ways not recommended...

* Routinized response behaviour is a type of purchasing scenario whereby the purchaser of a product or a service has past experience with purchasing it and automatically makes the decision to purchase again.

* Psychological influences refers to the workings of the mind or psyche that influences customer decisions.

* Social influences refers to the intentional and unintentional efforts to change another person's beliefs, attitudes, or behavior.

Therefore, the option that best suits the question is option B, CUSTOMER MISBEHAVIOR.

3 0
3 years ago
What does UDP stand for?
sleet_krkn [62]
User Datagram Protocol
3 0
3 years ago
Read 2 more answers
Medium-term goals describe what you want your business to achieve (a) in ten years, (b) in terms of market share, (c) in two to
77julia77 [94]

The correct answer to this question is Choice C- in two to five years.

Your medium-term goals may build upon your short term goals. For example, your short term goal may be to save $1,000. Building upon this, your medium-term goal could be to save $5,000.

3 0
3 years ago
Other questions:
  • A technician is troubleshooting a computer that will not communicate with any hosts on the local network. While performing a vis
    9·1 answer
  • When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
    8·1 answer
  • What is the name of the port that you plug an ethernet network cable into?
    6·1 answer
  • In the processes tab of task manager, the ____ tab displays the âworking setâ of a process, or the amount of memory it is active
    12·1 answer
  • Machines may aid in making work easier over a longer distance. true or false.
    7·1 answer
  • Kim would like to have a simple method for entering data into a database. She should create a _____.
    14·2 answers
  • Justin has started a lawn mowing business in his neighborhood. He is running a weed-pulling special this month. What is the most
    8·2 answers
  • I AM GIVING BRAINLEST!!!!!!!!
    14·2 answers
  • List the two page orientations in Microsoft word​
    10·1 answer
  • Does anybody have the answer for 2.19.6 checkerboard for codehs??
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!