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
Panes created using the vertical split bar scroll together horizontally. true or false.
Nataly_w [17]
I think the statement given above is false. Panes created using the vertical split bar do not scroll together horizontally. <span>The two </span>panes scroll together vertically, but scroll<span> independently </span>horizontally<span>. Hope this answers the question. Have a nice day.</span>
4 0
3 years ago
Which of the following are the rows or columns of white space created between grids?
erma4kov [3.2K]
It would be margins. none of the others are even terms for anything.
4 0
3 years ago
3.8 LAB: Read values into a list
Salsk061 [2.6K]

An example of Read values into a list is:

#!/usr/bin/python

list1 = ['math', 'chemistry', 1995, 2001];

list2 = [1, 2, 3, 4, 5, 6, 7 ];

print "list1[0]: ", list1[0]

print "list2[1:5]: ", list2[1:5]

<h3>What is Python Lists?</h3>

This is known to be a list that is seen as the a most versatile in terms of datatype that are known to be available in Python.

It is one that can be written as a list of comma-separated values that is found in between square brackets.

Note that the most Important thing about a list is that all the items in a list are ones that do not require to be of the same type.

Hence Creating a list is very simple to do and it is done by putting a lot of comma-separated values in between square brackets.

Therefore, An example of Read values into a list is:

#!/usr/bin/python

list1 = ['math', 'chemistry', 1995, 2001];

list2 = [1, 2, 3, 4, 5, 6, 7 ];

print "list1[0]: ", list1[0]

print "list2[1:5]: ", list2[1:5]

Learn more about python list  from

brainly.com/question/24232863

#SPJ1

8 0
1 year ago
• In your response, please include some examples of the three different types of storage.
babunello [35]
Hard Disk Drive
Solid State Drive
And Random Access Memory (RAM)
6 0
3 years ago
Read 2 more answers
All of these valid ways to earn money in microworkers except
vovikov84 [41]

Answer:

yes u are trus

Explanation:

mark me as brainliest hehe

8 0
2 years ago
Other questions:
  • Themes are applied from which tab?
    6·1 answer
  • Which of the following statements about Linux is not​ true? A. Linux works on all the major hardware platforms. B. It plays a ma
    5·1 answer
  • How many much memory is in one megabyte ?
    9·1 answer
  • How do i move a file in python3
    10·1 answer
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • Use Spreadsheet Functions and Formulas
    6·1 answer
  • Write any two disadvantage of First generations computers​
    14·1 answer
  • What does the word collaborative mean?
    13·2 answers
  • If a computer uses 500 characters, how many bits this system requires to give different code to all characters?
    15·1 answer
  • How do people and computers approach problems differently
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!