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
If after a run of arc consistency during the backtracking search we end up with the filtered domains of *all* of the not yet ass
Irina-Kira [14]

Answer:

True

Explanation:

3 0
4 years ago
Which of the following is NOT one of the three main ways to control a program when writing code?
Karo-lina-s [1.5K]
B. Derivative (Sorry If It’s Wrong)
5 0
3 years ago
Read 2 more answers
The labels on the tab buttons on the Driver tab of the Windows Device are Driver Details, Update Driver, Roll Back Driver, Unins
kifflom [539]

Answer:

Disable

Explanation:

In window devices, "Disable" is an option which is use as 'disables the selected device'. It is sub menu under Driver.

4 0
3 years ago
What is the command to create a compressed archive(archive1.tar.gz) of files test1 test2and test3.
yulyashka [42]

Answer:

The command to create a compressed archive (archive1.tar.gz) is

tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

Explanation:

The explanation for the above command is

The general command to create a compressed archive is

tar -czvf name-of-archive.tar.gz /path/to/directory-or-files

Here, the terms are as follows:

-c : Creates an archive

-z : Compress the archive with gzip.

-v : This is known as verbose. This is an optional command and it displays the progress on terminal command. Without this the progress is not displayed on terminal command.

-f : Allows to specify the file name of the archive.

Here, if we want to archive multiple files, we provide the command the names of multiple files or directories of the files also can be used.

So, the command tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

creates a compressed archive  - archive1.tar.gz of files test1, test2 and test3.

 

7 0
3 years ago
Need the answer ASAP!!!
Vlad1618 [11]

Answer: type and create of the software

Explanation:

pls mark brainliest

6 0
3 years ago
Other questions:
  • Abigail is interested in connecting her tablet that usually connects to a wireless network, to her personal computer that usuall
    11·2 answers
  • What three components make up a film camera?
    14·2 answers
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • A model release can be either oral or written down. true or false
    13·2 answers
  • Mobile apps known as news _________ collect articles from a variety of sources and present them to you in a magazine-style forma
    7·2 answers
  • In regard to protective actions for explosive devices, the area where the blast originates is referred to as ___________ perimet
    8·1 answer
  • which one of the following word process feature saves you the most time when you keying in a document
    9·1 answer
  • What area on the Microsoft® Publisher® application screen shows the name of the publication?
    9·1 answer
  • Pls help computer science I will give brainliest
    8·2 answers
  • You plan on using cost based pricing. The cost of your product is 10, and you are planning a 30% mark up. What should the price
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!