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
Goryan [66]
3 years ago
11

You would like to create a dictionary that maps some 2-dimensional points to their associated names. As a first attempt, you wri

te the following code:
points_to_names = {[0, 0]: "home", [1, 2]: "school", [-1, 1]: "market"}

However, this results in a type error.
Describe what the problem is, and propose a solution.

Computers and Technology
1 answer:
sleet_krkn [62]3 years ago
5 0

Answer:

A dictionary is a "key - value" pair data structure type. The syntax for creating a dictionary requires that the keys come first, before the values.

This problem in the question above is as a result of you interchanging the keys and values. THE KEYS MUST COME FIRST BEFORE THE VALUES

Explanation:

To solve this problem you will need to rearrange the code this way

points_to_names = {"home":[0, 0] , "school":[1, 2], "market":[-1, 1] }

See the attached code output that displays the dictionary's keys and values

You might be interested in
Alicia spends all day at work on the Internet and then all night on social networking sites looking at the many interesting thin
Stels [109]

Answer:

Better regulate time spent on internet

Explanation:

Because of the time Alicia is spending on the internet, seeing interesting things that her friends are doing, and perhaps her life has been boring, this tend to play with her psychology and she will begin to become depressed and start disliking her life. In this case, the main mediator is the internet, and the best way she can deal with depression at this level is to reduce or regulate the amount of time that she spends on the internet.

4 0
3 years ago
100 POINTS
agasfer [191]

Answer:

i'm just a kid ku ku ku ku ku ku ku ku ku ku ku ku

6 0
3 years ago
In the U.S. a standard mortgage requires a down payment of
Doss [256]
Atleast a minimum of 3%. Brainliest? 
6 0
4 years ago
Which app is good to make me all in one programming game developers full stack programmer ​
Elis [28]

Answer:

Bachelor of Animation at SAE or Bachelor of game development.

Hope this helps you!

Explanation:

5 0
3 years ago
The sun produces energy by the process of nuclear: <br><br> A.fission <br> B.fusion
ELEN [110]
Fission because fission puts them together
3 0
3 years ago
Read 2 more answers
Other questions:
  • You have an executive who needs her print jobs handled above those of others. how would you accomplish this advanced printing co
    8·1 answer
  • Which one is a correct answer
    12·2 answers
  • What feature is available to add a suggestion in the margin of someone else's document?
    7·1 answer
  • Write a program that prints the following text: In C, lowercase letters are significant. main() is where program execution begin
    14·1 answer
  • The ____ area on the status bar includes six commands as well as the result of the associated calculation on the right side of t
    5·1 answer
  • Papa Mario of Mario's Pizzeria has baked a huge pizza and cut it into n slices, but he is clumsy and the pizza wasn't evenly sli
    14·1 answer
  • Write a short assembly language program in either our 8088 SCO DOSBox or 80386+ MASM Visual Studio 2017 environment that demonst
    11·1 answer
  • Name the error that has happened in the binary addition 0¹01+111=1000​
    6·2 answers
  • What is the result of successfully applying a Machine Learning (ML)<br> algorithm to analyze data?
    15·1 answer
  • The template code provided is intended to take two inputs, x and y, from the user and print "pass" if one or more of the followi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!