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
solniwko [45]
3 years ago
7

Create a dictionary that maps a fruit name to its color. Both the keys and the values should be stored as strings. Include only

the following three entries in the dictionary: apple (red), orange (orange), and banana (yellow). Store the dictionary in a variable named fruit_dictionary.
Computers and Technology
1 answer:
UkoKoshka [18]3 years ago
6 0

Answer:

Written in Python:

fruit_dictionary = {}

fruit_dictionary = {'apple': 'red', 'orange': 'orange', 'banana': 'yellow'}

Explanation:

First (although, not necessary), we create an empty dictionary named fruit_dictionary on line 1

Next, we populate the dictionary using the following syntax:

{key-1:value-1, key-2:value-2,......,key-n:value-n}

In this case, the entry would be:

{'apple': 'red',

'orange': 'orange',

'banana': 'yellow'}

The items on the first column (i.e. apple, orange and banana) are the keys while the items on the second (i.e. red, orange and yellow) are the values of the dictionary

To print the items in the dictionary, you can add  the following line of code:

<em>print(fruit_dictionary.items()) </em>

You might be interested in
Each object that is created from a class is called a(n) ____________ of the class.
gladu [14]
Instance





-------------------------
7 0
3 years ago
Read 2 more answers
true or false? to change document properties, first tap or click file on the ribbon to open the properties view.
m_a_m_a [10]
I think its true but not sure
3 0
3 years ago
Read 2 more answers
Write an if else statement that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. O
brilliants [131]

Answer:

if(a < 10)

{ b = 0; c = 1;}

else

{ b = -99; c = 0;}

Explanation:

4 0
3 years ago
What should you do when you are working on an unclassified system and receive an email.
koban [17]

Answer:

Don't respond to it. Either leave it there, or just delete it. It is most likely spam or a scammer trying to get your information. Don't respond, please.

3 0
2 years ago
PLEASE HELP ASAP!!!!!!!!!!!
Bingel [31]

Answer:

True

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • The first character of the VIN designates which of the following? 
    15·2 answers
  • Need Help !!! Please
    8·1 answer
  • What is after Windows 8.1
    11·2 answers
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • Customizing ads to people who had earlier visited the site is
    14·1 answer
  • How many bytes does a common processor require to represent an integer?
    7·1 answer
  • Join zoom meet <br>id=547 458 9345<br>pw=sencHURI​
    8·2 answers
  • Which terms means device that converts one voltage to another ?
    15·1 answer
  • How many ways are used to insert an image from file?koi h kya​
    10·1 answer
  • what is one category of software mentioned in the unit materials as being example of groupware English technical
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!