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
Compare and contrast system software and generalised software
jekas [21]
System software is a type of computer program that is designed to run a computer’s hardware and application programs.
Generalized software refers to software designed to read, process and write data with the help of functions performing specific audit routines and with self-made macros.
3 0
4 years ago
What is microsoft access?
atroni [7]
Microsoft Access is a database management system that is part of the Microsoft Office Suite.
8 0
4 years ago
what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?
Zigmanuir [339]

Answer:

Image result for what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?

Common applications of X. 509 certificates include SSL/TLS and HTTPS for authenticated and encrypted web browsing, signed and encrypted email via the S/MIME protocol, code signing, document signing, client authentication, and government-issued electronic ID.

Explanation:

8 0
3 years ago
Which type of image is not a supported using the Online Pictures or Insert Picture command?
IgorC [24]

Answer:

HTML  i think

Explanation:

4 0
3 years ago
Read 2 more answers
What are Three types of informational references
Irina-Kira [14]

Answer:

There are many types of information al references such as Encyclopedias, dictionaries, thesaurus Almanacs, atlases, thesauruses, Atlases, almanacs, and encyclopedias.

Explanation:

There are also informational websites. The way to find this is to look at the website url to see if it ends in .gov, .edu, and .org . But make sure you cite your source so you don't plagiarize.

If you don't have any questions feel free to ask in the comments.

3 0
3 years ago
Read 2 more answers
Other questions:
  • A block style business letter is:
    5·1 answer
  • A graph of an organization'snet income over the past 10 years is an example of an analogmodel.
    7·1 answer
  • How do headphones work? (From pc)
    8·1 answer
  • There are many different types of documents that are used to convey information in the business world-letters and
    12·1 answer
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • A newspaper wants to estimate the proportion of Americans who will vote for Candidate A. A random sample of 1000 voters is selec
    14·1 answer
  • Consider the following statement from the CS Principles course framework: The global distribution of computing resources raises
    12·1 answer
  • A company has an Aruba solution. The company wants to host a guest login portal with this solution, and the login portal must gi
    7·1 answer
  • IN EXCEL, File, menu , edit, insert are all located in ?
    7·1 answer
  • A Network Intrusion Detection System watches for potentially malicious traffic and _______ when it detects an attack.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!