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
Genrish500 [490]
3 years ago
7

Write a loop that prints each country's population in country_pop. Sample output with input:

Computers and Technology
1 answer:
Nostrana [21]3 years ago
4 0

Answer:

  1. country_pop = {
  2.    'China': 1365830000,
  3.    'India': 1247220000,
  4.    'United States': 318463000,  
  5.    'Indonesia': 252164800
  6. }  
  7. for key in country_pop:
  8.    print(key + " has " + str(country_pop[key]) + " people")

Explanation:

The solution code is written in Python 3.

Given a dictionary, country_pop with data that includes four country along with their respective population (Line 1-6). We can use for in loop structure to traverse through each of the key (country) in the dictionary and print their respective population value (Line 7-8). The general loop structure through is as follow:

                    for key in dict:

                         do something

One key will be addressed for each round of loop and we can use that key to extract the corresponding value of the key (e.g. country_pop[key]) and print it out.

You might be interested in
What is the LER for a rectangular wing with a span of 0.225m and a chord of 0.045m
ch4aika [34]

Calculate LER for a rectangular wing with a span of 0.225m and a chord of 0.045m. The weight of the glider is 0.0500 Newtons. (Note: the wing span is the width of the wing and is measured from wing tip to wing tip, or perpendicular to the fuselage. The wing chord is the length of the wing measured parallel or along the length of the fuselage.)

Answer:

Area of rectangular wing = span × chord = 0.225×0.045= 0.010125m2

LER = Area/weight = 0.010125/0.0500 = 0.2025

4 0
2 years ago
Describe one practical application of total internal reflection. ​
Delicious77 [7]

Answer:

The phenomenon of total internal reflection of light is used in many optical instruments like telescopes, microscopes, binoculars, spectroscopes, periscopes etc. The brilliance of a diamond is due to total internal reflection. Optical fibre works on the principle of total internal reflection.

Explanation:

thank me later but if it wrong. sorry

8 0
3 years ago
Which of the following questions will most likely be answered by displaying data on a line graph?
Artemon [7]
I'm pretty sure the answer is b
4 0
3 years ago
The ancient city of Pompeii was destroyed when a mixture of hot volcanic gases, ash, and rock poured down Mount Vesuvius and cov
LekaFEV [45]
C. Pyroclastic flow and D. Tephra
7 0
3 years ago
Read 2 more answers
4. Why isn't it realistic to market a new product using promoted tweets?
erica [24]

Answer:

Great question

Explanation:

is not realistic because nearly everyone doesn't even consider to look at the ad. Most people actually find it annoying when they are scrolling on their feed and all of a sudden an ad pops up.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Pleaseeee help me w this!
    10·1 answer
  • T FROW PYCW GCYN TA T ODYHP WQROW TW<br><br> Someone decode pls
    14·1 answer
  • Which of the following statements is true?
    9·1 answer
  • Give a real life of an if statement
    13·1 answer
  • PLS HEEELLLP ASAP, DONT JOKE
    9·2 answers
  • Q Basic program write a program in Q Basic to find the cost of 10 pens when the cost of 15 pens is 75 use unitary method to find
    8·1 answer
  • Simple example of hybrid computer​
    7·2 answers
  • What are the three main elements common to all radio ads?
    9·2 answers
  • 1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
    12·1 answer
  • Vẽ sơ đồ DFD cho của hàng bán điện thoại ( Môn phân tích và thiết kế hệ thống thông tin)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!