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
kvv77 [185]
3 years ago
10

Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should NOT

be added to the list). These values entered by the user are added to a list we call 'initial_list'. Then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. Finally, inside main(), print out all of the values in the new list.
Computers and Technology
1 answer:
Free_Kalibri [48]3 years ago
5 0

Answer:

def create_3_copies(initial_list):

   another_list = []

   

   for i in range(3):

       for x in initial_list:

           another_list.append(x)

   return another_list

   

initial_list = []

while True:

   value = input("Enter a value: ")

   if value == "exit":

       break

       

   initial_list.append(value)

for x in create_3_copies(initial_list):

    print(x, end=" ")

Explanation:

Create a function that takes initial_list as parameter. Inside the function:

Create an empty list called another_list

Create a nested for loop. The outer loop iterates 3 times (Since we need to add every value 3 times). The inner loop iterates through the another_list and adds each value to the another_list.

When the loops are done, return the another_list

In the main:

Create an empty list named initial_list

Create an indefinite while loop. Inside the loop, ask the user to enter a value. If the value equals "exit", stop the loop. Otherwise, add the value to the initial_list

Create another for loop that calls the function we created passing the initial list as a parameter and iterates through the values that it returns. Inside the loop, print each value

You might be interested in
Matt Cooper of Soggy Bottom Canoe and Kayak Rental refers to concept testing as​ _____ testing.
andrezito [222]

Answer:

Beta

Explanation:

Beta testing is a Quality Assurance process, where Developers and testers evaluate the quality of application experience from the point of view of the users, who are the most important targets of any software product.

5 0
4 years ago
A specific form of IT that managers use in order to have access to the specific information they need to perform their job effec
mr_godi [17]

Answer:

management information

Explanation:

management information systems are a specific form of IT that managers design in order to have access to specific information which they need to perform job effectively.

5 0
3 years ago
Is a device used to test the network connection.
shtirl [24]

Explanation:

a cable tester is a device which is used to test network connection

3 0
2 years ago
Read 2 more answers
How can people efficiently and effectively influence lots of people throughout the world
tatuchka [14]

Answer:

The word efficient denotes the ability to achieve a good goal toward a person, and effectiveness denotes reliable production or achievement.

Explanation:

Many people around the world can set efficient goals, that is, to influence or encourage other people to make good projects or changes in their lives, by example or simply teach them with patience and altruism.

In this way effectiveness will be seen, that is, the product or the achievement precisely when we observe how people undertake new projects in their lives

3 0
4 years ago
Kiểm tra cặp số hứa hôn
SCORPION-xisa [38]

Answer:

Sorry im not Vietnam so please explain it in English or ask someone who can speak Vietnam to help you

3 0
3 years ago
Other questions:
  • Can the redirection shell metacharacter be used to redirect between a command and another command?
    8·1 answer
  • Which is the main reason why IT professionals need to pursue continuing education and self-directed learning?
    6·2 answers
  • I need to create a function that returns Pascal's Triangle with n rows, where n is an int argument.
    12·1 answer
  • Derek has an interest in designing video games. What requirements should he fulfill to be a game designer?
    11·1 answer
  • Why is IP configuration used with its components for network, broadcast, host addresses, and local host?
    9·1 answer
  • What is the most likely reason that a digital artist would use a program such as Autodesk Maya or Max to create 3-D images for a
    12·1 answer
  • Write an algorithm for a program which inputs the lengths a, b and c of the three sides of a triangle. The program then determin
    9·1 answer
  • PLS HELP) Early word processors ran on devices that looked like digital _______?
    10·2 answers
  • Which best describes sorting, filtering, and deleting records?
    6·1 answer
  • Jacob holds a Computer Hacking Forensic Investigator (CHFI) certification. Which of the following responsibilities should Jacob
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!