Write a loop that prints each countrys population in country_pop.


Asked by wiki @ in Computers and Technology viewed by 150 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 expressions are equivalent when m 1 and m 4

Asked by wiki @ in Mathematics viewed by 274 persons

Which expressions are equivalent when m=1 and m=4? A. 5m-3 and 2m+5+m B. 3m+4 and m+4+2m C. 2m+7 and 3m-3+m D. 5m+3 and 4m+2+2m

The two angled ropes are used to support the crate

Asked by wiki @ in Physics viewed by 231 persons

The two angled ropes are used to support the crate in the picture. The sum of the tension in the ropes can have any value up to 1500 N. When …

How many valence electrons are in a neutral lithium atom

Asked by wiki @ in Chemistry viewed by 390 persons

How many valence electrons are in a neutral lithium atom

Why were southerners opposed to the election of abraham lincoln

Asked by wiki @ in History viewed by 246 persons

Why were southerners opposed to the election of Abraham Lincoln

A food worker cleans the inside of a pizza oven

Asked by wiki @ in Health viewed by 2867 persons

A food worker cleans the inside of a pizza oven using a steel wire brush. After the oven is clean, it is set to 500 degrees to cool the pizza. …

What kind of pain can exercising right after eating cause

Asked by wiki @ in Health viewed by 208 persons

What kind of pain can exercising right after eating cause? O A. Cramps and a stomachache. O O B. Soreness in your joints. O c. If you're swimming, an inner …

A company is having a contest for the best way

Asked by wiki @ in Business viewed by 244 persons

A company is having a contest for the best way to reduce energy use all ideas must be in the form of a written report how will it help the …

Group of elements with the same number of valence electrons

Asked by wiki @ in Physics viewed by 261 persons

Group of elements with the same number of valence electrons

Offers high speed internet connections to devices with built in

Asked by wiki @ in History viewed by 258 persons

Offers high-speed Internet connections to devices with built-in compatible technology or computers with wireless modems. A. Cable Internet service B. digital subscriber line C. Cellular radio rewark 0. Fiber to …

Which of the following is not an example of matter

Asked by wiki @ in Chemistry viewed by 221 persons

Check my answers, please? 1. which of the following is NOT an example of matter? a. air b. heat* c. smoke d. water vapor 2. All of the following are …

Many organs working together to do a special job form

Asked by wiki @ in Biology viewed by 279 persons

A group of organs that work together to perform a common function is called an)

Personality psychology can be best defined as the study of

Asked by wiki @ in Social Studies viewed by 238 persons

Which of the following statements best defines personality? It refers to the impersonal, deepest layer of the unconscious mind, shared by all human beings because of their common ancestral past. …

What is the difference between assessment and evaluation in education

Asked by wiki @ in Health viewed by 243 persons

Explain the difference between assessment and evaluation

Which of the following statements about prescribed burns is true

Asked by wiki @ in Biology viewed by 102 persons

Which of the following statements about prescribed burns is true?a. Prescribed burns will always have detrimental effects on ecosystems, but should be used to protecthomesb. Prescribed burns are necessary for …

What is the greatest common factor of 36 and 54

Asked by wiki @ in Mathematics viewed by 279 persons

What is the GCF (greatest common factor) of 36 and 54

How does a renewable resource differ from a nonrenewable resource

Asked by wiki @ in Biology viewed by 224 persons

How does a renewable resource differ from a nonrenewable resource? A. A renewable resource can be used only in developed countries. B. A nonrenewable resource is being used faster than …

Why does the west wind drift flow to the east

Asked by wiki @ in Geography viewed by 218 persons

Why does the west wind drift flow to the east?

How to build a shelter when stranded on an island

Asked by wiki @ in Mathematics viewed by 142 persons

After a shipwreck, Florence is stranded on a desert island. She needs to build a shelter, so she makes an axe using materials from the wreckage and starts cutting down …

A person with strong core muscles has improved posture and

Asked by wiki @ in Health viewed by 246 persons

A person with strong core muscles has improved posture and a. reduced chance of injury. b. reduced training time. c. enhanced cardiovascular fitness. d. the ability to lift free weights.

Which of the following foods does not support bacteria growth

Asked by wiki @ in Health viewed by 260 persons

Which of the following foods does not support bacteria growth? Refried beans raw carrots sauteed onions cooked rice

The federalist papers mainly argued that the constitution

Asked by wiki @ in History viewed by 209 persons

The “Federalist Papers” mainly argued that the Constitution A) should be changed so enslaved people would not be counted in the population. B) needed a bill of rights to guarantee …

Determine whether each of these processes is reversible or irreversible

Asked by wiki @ in Chemistry viewed by 307 persons

Determine whether each of these processes is reversible or irreversible.Drag the appropriate items to their respective bins.Bins: Reversible and Irreversible1) solid melting infinitesimally slowly at its melting point2) a single …

What is the difference between a pot and a saucepan

Asked by wiki @ in Mathematics viewed by 108 persons

What is the difference between a pot and a saucepan?

Which of the following is true about compounds

Asked by wiki @ in Chemistry viewed by 279 persons

Which of the following is true about compounds? 1) They can be physically separated into their component elements. 2) They have properties similar to those of their component elements. 3)They …

The ions in most ionic compounds are organized into a

Asked by wiki @ in Chemistry viewed by 319 persons

The ions in most ionic compounds are organized into a

How were deng xiaoping's economic policies different from mao zedong's

Asked by wiki @ in History viewed by 394 persons

How were Deng Xiaoping’s economic policies different from Mao Zedong’s? Deng supported land ownership for the upper classes; Mao supported land ownership for peasants. Deng supported communes in rural areas; …

Why is the product of two rational numbers always rational

Asked by wiki @ in Mathematics viewed by 339 persons

Why is the product of two rational numbers always rational? Select from the drop-down menus to correctly complete the proof. Let a/b and c/d represent two rational numbers. This means …

Who founded the first circulating library in the united states

Asked by wiki @ in Social Studies viewed by 274 persons

Benjamin Franklin started: a. the first circulating library in America. b. the first American book printing press. c. the first bookstore. d. the first American publishing house.

Which applies the power of a product rule to simplify

Asked by wiki @ in Mathematics viewed by 258 persons

Which applies the power of a product rule to simplify (5t)^3? a. (5t)^3 =5t^3 b. (5t)^3 = 3(5t) = 15t c. (5t)^3 = 5^3 t^3 = 125t^3 d. (5t)^3 = …

What are the benefits of having a shorter written constitution

Asked by wiki @ in History viewed by 224 persons

What are the benefits of having a shorter written constitution?

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 4841 persons


The following are ways to avoid having a collision except

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



Which internet protocol version is 100.0 0.256

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



Which item is not part of a college application everfi

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


Which one of these can connect directly to the internet

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



What makes a sequence of database operations a transaction

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


Which of the following is not true about mobile health

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



Where is the resume document located in this file structure

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


Cloud storage refers to the storage of data on

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