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
Questions about the data policy and privacy policy of YT
Ilya [14]

Answer:

I'm confused

Explanation:

7 0
3 years ago
Choose the list of the best uses for word processing software.
Marina86 [1]
List, resumes, spread sheet, databases, contracts
4 0
3 years ago
How does the action affect the end result of what you want to accomplish?
suter [353]

Whichever action you take to complete a task will inevitably affect the end result of whatever would need to be accomplished; whether this impact the task in a positive or a negative way.

3 0
3 years ago
How are gems and precious metals similar?
Ierofanga [76]
The answer would be d they are both rare and valuable minerals
7 0
2 years ago
Read 2 more answers
WAP to enter a multidigit number and find the sum of only even digits in a number.​
daser333 [38]

Following are the program to calculate even digits sum:

<h3>Program:</h3>

#include <iostream>//header file

using namespace std;

int main()//main method

{

   int a[10],s=0,i;//defining an array and an integer variable

   cout<<"Enter array values: ";//print message

   for(i=0;i<=9;i++)//defining a loop that input array value

   {

       cin>>a[i];//input array value

   }

   for(int i=0;i<=9;i++)//defining loop that check array value

   {

       if(a[i]%2==0)//defining if block that checks even number condition value

       {

           s=s+a[i];//adding even number value

       }

   }

   cout<<"The sum of even number is: "<<s;//print even number sum value

   return 0;

}

Program Explanation:

  • Defining a header file.
  • Defining the main method.
  • Inside the main method, an integer array "a", and two integer variable "s,i" is declared.
  • In the next step, a for loop is declared that input the array value, and after input value another loop is declared that check even number value in array.
  • In this loop it adds array value and after adding the value a print method is declared that prints its value.

Output:

Please find the attached file.

Find out more information about the even number here:

brainly.com/question/4184435

6 0
2 years ago
Other questions:
  • What might be the best response to a cyberbuly attack
    6·2 answers
  • What is the decimal equivalent of (11000 + 10000)/101?
    10·1 answer
  • Which type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals?
    7·2 answers
  • Given the variables full_admission_price and discount_amount (already defined), write an expression corresponding to the price o
    15·1 answer
  • In the cases of int, byte, long, short (In Java) Can you give the heirachy in ascending order?​
    6·1 answer
  • Translation of a file into a coded format that occupies less space than the original file is called
    15·1 answer
  • PLZ ANSWER IT..<br>IT IS VERY URGENT....​
    7·1 answer
  • Which shortcut key combination will move the cursor to the beginning of the line?
    13·1 answer
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • How to transfer mysql database from one server to another
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!