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
Write two sentences but each one having either computer in it or technology in it. You can use a word more than once in a senten
Ksju [112]

Answer:

Sentences:

1.My computer has a virus

2.Technology may take over the world someday

Explanation:

7 0
3 years ago
Read 2 more answers
Microsoft has developed a method for measuring a system's total costs and benefits, called ____, which is a framework to help IT
Korvikt [17]

Answer:

It is called B. REJ

Explanation:

REJ means Rapid Economic Justification. This is a methodology or framework to help IT professionals analyze IT investments. The main aim of this framework for business optimization

7 0
3 years ago
When designing a slide for presentation, it is best to include as much information as possible on every slide. True Or False
Mariulka [41]

Answer:

false

Explanation:

try to limit the amount of info on each slide

4 0
3 years ago
Read 2 more answers
What are the different type of computer files?
oee [108]

Answer:

There actually a lot of them: World, PPT, Excell

Explanation:

6 0
3 years ago
Read 2 more answers
_____ software is used to play, create, and modify audio and video files.
joja [24]
It's most likely multimedia.
4 0
3 years ago
Other questions:
  • A file that contains program code is called a ____________.
    13·1 answer
  • Yet another variation: A better packet switched network employs the concept of acknowledgment. When the end user’s device receiv
    11·1 answer
  • WILL UPVOTE NEED ANSWERS ASAP i have till 4:30
    12·1 answer
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • The collection of computer instructions and other files that constitute a piece of software is
    9·2 answers
  • What can search the internet and select elements based on important words
    10·1 answer
  • (a) Store last 7 digits of your student ID in a vector (7 element row or column vector). Write a MATLAB code which creates a 7x7
    11·1 answer
  • Define a function called 'findWordFreq, which takes two parameters. The first parameter, 'text" is an nltk.text.Text object and
    8·1 answer
  • Pls say correct guyz pls pls pls
    7·1 answer
  • This provides an easy method for workers to use their computers. FAT FAT RAM RAM DOS DOS GUI
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!