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
harina [27]
3 years ago
14

Consider bears = {"Grizzly":"angry", "Brown":"friendly", "Polar":"friendly"}. Can you replace #blank# so the code will print a g

reeting only to friendly bears? Your code should work even if more bears are added to the dictionary. for bear in bears: if #blank#: print("Hello, "+bear+" bear!") else: print("odd") Enter your code here.
Computers and Technology
1 answer:
Goshia [24]3 years ago
6 0

Answer:

bears = {"Grizzly":"angry", "Brown":"friendly", "Polar":"friendly"}

for bear in bears:

   if bears[bear] == "friendly":

       print("Hello, "+bear+" bear!")

   else:

       print("odd")

Explanation:

A dictionary called bears is given. A dictionary consists of key-value pairs.

You need to check each key-value pairs in bears and find the ones that have "friendly" as value using a for loop and if-else structure. In order to access the values of the dictionary, use the dictionary name and the key (inside the loop, the key is represented as bear variable). If a key has a value of "friendly", print the greeting. Otherwise, print "odd".

You might be interested in
Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
enot [183]

Answer:

b)void aNonclassFunction (Banana co);

Explanation:

In the function definition you have to pass the tell the function which type of argument it is taking.In our case we are taking a variable co of Banana type passing it to the function named aNonclassFunction having no return type.

So the definition will be like this.

void aNonclassFunction (Banana co);

6 0
3 years ago
For an alternative to the String class, and so that you can change a String's contents, you can use_________ .
mr_godi [17]

Answer:

c. StringBuilder

Explanation:

An alternative to the String class would be the StringBuilder Class. This class uses Strings as objects and allows you to mix and match different strings as well as adding, removing, implementing,  and modifying strings themselves as though they were similar to an array. Unlike the string class StringBuilder allows you to modify and work with a combination of strings in the same piece of data as opposed to having various objects and copying pieces which would take up more memory.

7 0
3 years ago
A slide show is another name for a PowerPoint presentation. <br> a. True<br> b. False
ruslelena [56]
It is true because a powepoint is a projecter

8 0
3 years ago
Read 2 more answers
What is one piece of equipment every food establishment needs?
natulia [17]
A food establishment needs a thermometer to make sure no food is under cooked or overly cooked
8 0
3 years ago
How do you fix The lag on your zsnes emulator
GenaCL600 [577]
Try resetting the phone if that doesn’t work do a hard reset
7 0
2 years ago
Other questions:
  • Connected contacts require___ to open.
    11·1 answer
  • You should use _____ software for writing a letter.
    10·1 answer
  • Liz will use a CD-R compact disk to write to more than once. Carlo will use a CD-RW compact disk to write to more than once. Who
    8·2 answers
  • What should you use as the argument for the goto() command?
    6·1 answer
  • What filter gives a “squeezed” effect to an image?
    14·2 answers
  • Direct connections provide continuous access to the Internet. Many bandwidth options are associated with direct connections. Whi
    9·1 answer
  • Prove each statement using a proof by exhaustion. For every integer n such that 0 lessthanorequalto n &lt; 3, (n + 1)^2 &gt; n^3
    9·1 answer
  • A web application is an example of:
    7·1 answer
  • Which picture should i put as my profile picture.
    15·2 answers
  • MULTI SELECTION
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!