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
Given an list of N integers, Insertion Sort will, for each element in the list starting from the second element: Compare the ele
Elena L [17]

Answer:

def insSort(arr):

ct=0;

for i in range(1, len(arr)):

key = arr[i]

j = i-1

while j >=0 and key < arr[j] :

arr[j+1] = arr[j]

j -= 1

ct=ct+1;

arr[j+1] = key

return arr,ct;

print(insSort([2,1]))

Output of the program is also attached.

8 0
3 years ago
When parking uphill on a street with no curb, how should your front wheels be positioned? A. Turned to the left (toward the stre
Shkiper50 [21]
The answer is B. It matters which way you park your car . Your car should also be parallel to the carb but with the wheels inward to the right
8 0
3 years ago
Read 2 more answers
FREE BRAINLIEST!!!
Nastasia [14]

Answer:

B

Explanation:

4 0
3 years ago
Read 2 more answers
The National Institute of Standards and Technology (NIST) guidelines list four different states a mobile device can be in when y
Ahat [919]

Answer:

quiescent

Explanation:

The National Institute of Standards and Technology (NIST) guidelines list four different states a mobile device can be in when you extract data. The quiescent mode is a dormant mode that conserves battery life while maintaining user data and performing other background functions.

4 0
3 years ago
What is the most important external issue when using social media in emergency management?
DerKrebs [107]
Th e most important external issue when using social media in emergency management is the disaster response. Disseminating information through social media is very effective especially when there are calamities and a disaster respond from both private and public sector is very urgent.
8 0
3 years ago
Other questions:
  • In an airline reservation system, on entering the flight number, the flight schedule and the flight status are displayed. In thi
    8·2 answers
  • A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
    7·1 answer
  • A(n) _____ allows a user to choose specific files to back up, regardless of whether or not the files have been changed.
    9·1 answer
  • Read the section, "Junior Year." Why would someone chose to complete an apprenticeship after high school? How many occupations c
    14·2 answers
  • The ____ method returns an integer that represents the location of the substring within the string.
    13·1 answer
  • Which descriptions offer examples of Correction Services workers? Select all that apply.
    8·1 answer
  • Mô tả những lợi ích của việc sử dụng đa xử lý không đồng nhất trong một hệ thống di động
    8·1 answer
  • A computer is made up of hardware and software ​
    5·1 answer
  • Write a program, called compute_stats.c, which opens a data file, called numbers.txt, which contains of a list of positive integ
    10·1 answer
  • There are some games that cannot be described by a single--or even two-- genres. Can you think of any that should be invented?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!