Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

zyBooks My library > IT 140: Introduction to Scripting v3 home > zyBooks catalog ? Help/FAQ 6.16: Iterating over a dictionary CHALLENGE ACTIVITY 6.16.1: Report

image text in transcribed
zyBooks My library > IT 140: Introduction to Scripting v3 home > zyBooks catalog ? Help/FAQ 6.16: Iterating over a dictionary CHALLENGE ACTIVITY 6.16.1: Report country population. 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. 247772.2309728.qx3zqy7 1 user_input = input() 1 test 2 entries = user_input . split(' , ') passed 3 country_pop = {} 4 All tests 5 for pair in entries: passed 6 split_pair = pair . split(' : ') country_pop [split_pair[0]] = split_pair[1] 8 # country_pop is a dictionary, Ex: { 'Germany': '82790000', 'France': '67190000' } 9 " "Your solution goes here' ' 10 11 print(country, 'has', pop, 'people. ')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

For what purposes are departmental reports useful to management?

Answered: 1 week ago

Question

What connects two hemisphere of the brain?

Answered: 1 week ago

Question

Fluid filled cavity in the brain is called as........?

Answered: 1 week ago

Question

Which part of the brain controls emotions experience?

Answered: 1 week ago

Question

What part of a neuron responsible for receiving information?

Answered: 1 week ago

Question

In evolutionary terms with is the oldest pat of the brain ?

Answered: 1 week ago