Question

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

PYTHON PROGRAMMING

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.
0 0
Add a comment Improve this question Transcribed image text
Answer #1
country_pop={"United States": 318463000, "India" : 1247220000, "Indonesia" : 252164800, "China": 1365830000 }
for key,value in country_pop.items():
    print(key +" has "+ str(value) +" people.")

Add a comment
Know the answer?
Add Answer to:
PYTHON PROGRAMMING Write a loop that prints each country's population in country_pop. Sample output with input:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT