Write a loop that prints each countrys population in country_pop.


Asked by wiki @ in Computers and Technology viewed by 51 People


Write a loop that prints each country's population in country_pop. Sample output with input: 'China:1365830000,India:1247220000,United States:318463000,Indonesia:252164800': United States has 318463000 people. India has 1247220000 people. Indonesia has 252164800 people. China has 1365830000 people.

Answered by wiki @



Answer:

The correct code is for country,pop in country_pop.items():  

   print(country, 'has', pop, 'people.')

Explanation:

country_pop={"United States": 318463000, "India" : 1247220000, "Indonesia" : 25216480, "China": 1365830000 }

for key value in country_pop.items(): print(key +" has "+ str(value) +" people.")


Do you know the better answer?

Similar Questions

Which one of the following descriptions best describes horizontal integration

Asked by wiki @ in History viewed by 179 persons

Which one of the following descriptions best describes "horizontal integration"?

The sciatic nerve divides into the tibial and __________ nerves

Asked by wiki @ in Biology viewed by 77 persons

As the _______ nerve approaches the knee, it divides into two branches, the common fibular nerve and the tibial nerve.

What is the theme of the pedestrian by ray bradbury

Asked by wiki @ in English viewed by 65 persons

PLS HELP What is the theme in "The Pedestrian" by Ray Bradbury?

Which part of speech takes the place of a noun

Asked by wiki @ in English viewed by 116 persons

Which part of speech takes the place of a noun? A. verb B. pronoun C. adverb D. adjective

In an outline capital letters designate

Asked by wiki @ in English viewed by 89 persons

In an outline, capital letters designate A. main topics. B. subtopics. C. subdivisions. D. classification.

What is the main cause of any change of state

Asked by wiki @ in Chemistry viewed by 185 persons

What is the main cause of any change of state?

Which organisms in the chart can produce atp by photosynthesis

Asked by wiki @ in Biology viewed by 175 persons

Which organisms in the chart can produce ATP by photosynthesis? Organism Cells contain chloroplasts Algae X Amoebas Mushrooms Oak trees X Bermuda grass X All of these organisms produce ATP …

What do they call the international hula hoop championships worksheet

Asked by wiki @ in Mathematics viewed by 381 persons

What do they call the international, hula hoops championship? Its for a math worksheet

What is the difference between global trade and domestic trade

Asked by wiki @ in Business viewed by 130 persons

What is the difference between global trade and domestic trade?

The code of hammurabi is a product of this civilization

Asked by wiki @ in History viewed by 92 persons

The Code of Hammurabi is a product of this civilization. Mesopotamian Indus Mycenaean Minoan

What is the symbol for iron on the periodic table

Asked by wiki @ in Chemistry viewed by 72 persons

Using the periodic table entry of iron below, match the numbers with what they represent. 1. The number 26 atomic number 2. The number 56 number of valence electrons 3. …

Which of the following is true about impervious building materials

Asked by wiki @ in Biology viewed by 61 persons

Which of the following is true about impervious building materials? a. Impervious surfaces prevent pollutants from entering the water supply. b. Vegetation and gravel are common impervious materials. c. Having …

Which can carry pathogens for both strep throat and tuberculosis

Asked by wiki @ in Health viewed by 40 persons

Which can carry pathogens for both strep throat and tuberculosis?

The mughal empire was established in the early 1500s by

Asked by wiki @ in History viewed by 104 persons

HELP ME PLEASE!!!! I NEED HELP!!!!! The Mughal empire was established in the early 1500s by_________. A. Delhi Sultan, Ibrahim Shah Lodi B. Prince Babur of Timurid C. The Takhts

What motivates the stranger to ask elisa about her chrysanthemums

Asked by wiki @ in English viewed by 32 persons

What motivates the stranger to ask elisa about her chrysanthemums

What is the difference between a layoff and being fired

Asked by wiki @ in Business viewed by 25 persons

What is the difference between a layoff and being fired?

What are the two main divisions of the nervous system

Asked by wiki @ in Biology viewed by 186 persons

What are the two main divisions of the nervous system

Women who go on _______ commonly lose their menstrual periods

Asked by wiki @ in Biology viewed by 143 persons

Women who go on . . . commonly lose their menstrual periods ? a. exercise binges b. eating binges c. severe diets d. high protein diets

The purpose of the office of the president is to

Asked by wiki @ in History viewed by 105 persons

The purpose of the office of the president is to help run the government. sign or veto pending legislation. nominate or appoint officials. advise the president on education.

What organizational changes might you recommend to the auto companies

Asked by wiki @ in Social Studies viewed by 103 persons

What organizational changes might you recommend to the auto companies? the airline industry?

Magic realm inc has developed a new fantasy board game

Asked by wiki @ in Business viewed by 116 persons

Magic Realm, Inc., has developed a new fantasy board game. The company sold 15,000 games last year at a selling price of $20 per game. Fixed costs associated with the …

The smallest piece of information on a computer is the

Asked by wiki @ in Computers and Technology viewed by 144 persons

The smallest piece of data used by a computer is a(n) _____.

Which of these is a disadvantage of insulin pump technology

Asked by wiki @ in Health viewed by 27 persons

Which of these is a disadvantage of insulin pump technology? A. high cost B.inaccuracy C. health risk D. Radiation exposure

A pine tree growing on a hillside makes a 75

Asked by wiki @ in Mathematics viewed by 220 persons

A pine tree growing on a hillside makes a 75° angle with the hill. from a point 80 feet up the hill, the angle of elevation to the top of …

Which of the following establishments would be considered on premise

Asked by wiki @ in Business viewed by 162 persons

Which of the following establishments would be considered “on premise” a. convenience store b. gas station c. liquor store d. restaurants

Compare early drip irrigation systems to modern drip irrigation systems

Asked by wiki @ in Social Studies viewed by 171 persons

Compare early drip irrigation systems to modern drip irrigation systems.

Which soil would most likely be found in the arctic

Asked by wiki @ in History viewed by 155 persons

Which soil would most likely be found in the Arctic

How many gallons of water does a swimming pool hold

Asked by wiki @ in Mathematics viewed by 190 persons

An Olympic-sized swimming pool holds 2,500,000 liters of water. How many gallons of water does an Olympic-sized swimming pool hold? Round your answer to the nearest tenth.

What kind of meter is robert frost known for using

Asked by wiki @ in English viewed by 156 persons

What kind of meter is Robert Frost known for using? A. Free verse. B. Iambic pentameter. C. Open form. D. Dactylic trimeter.

Describe the type of gold used for trade in ghana

Asked by wiki @ in History viewed by 105 persons

Describe the type of gold used for trade in Ghana. please help

Most viewed questions in Computers And Technology


A customer wants to increase the storage capacity by 25gb

Asked by wiki @ in Computers and Technology viewed by 4475 persons


The following are ways to avoid having a collision except

Asked by wiki @ in Computers and Technology viewed by 1565 persons



Which internet protocol version is 100.0 0.256

Asked by wiki @ in Computers and Technology viewed by 1220 persons



Which item is not part of a college application everfi

Asked by wiki @ in Computers and Technology viewed by 1102 persons


Which one of these can connect directly to the internet

Asked by wiki @ in Computers and Technology viewed by 1096 persons



What makes a sequence of database operations a transaction

Asked by wiki @ in Computers and Technology viewed by 1038 persons


Which of the following is not true about mobile health

Asked by wiki @ in Computers and Technology viewed by 984 persons



Cloud storage refers to the storage of data on

Asked by wiki @ in Computers and Technology viewed by 680 persons