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
Alexeev081 [22]
2 years ago
5

g 'write a function that takes as input a list and outs a new list containing all elements from the input

Computers and Technology
1 answer:
atroni [7]2 years ago
5 0

Answer:

def mylist(*args):

   return args

new_list = mylist(2,3,4,5)

Explanation:

The simple python code above defines a function called mylist that receives multiple length of element as a list and returns the list a new list. The "*args" allows the function to receive any number of item and converts them to a list that is returned in the next statement.

The can also be achieved by simply assigning a squared bracket enclosed list to the variable or with the list() constructor.

You might be interested in
Given the list of customer segments below please create a new list of the names of the segments only using(a) a for loop(b) a li
Alchen [17]

Answer:

new_segment = [ ]

for segment in segments:

   new_segment.append({'name': segment, 'average_spend': money})

print( new_segment)

Using list comprehension:

new_segment =[{'name': segment, 'average_spend': money}  for segment in segments]

Using map():

def listing(a):

   contain =  {'name': segment, 'average_spend': money}

   return contain

new_segment = [ ]

new_segment.append(map( listing, segment))

print(list(new_segment)

Explanation:

The python codes above create a list of dictionaries in all instances using for loop, for loop in list comprehension and the map function which collect two arguments .

7 0
3 years ago
What are the uses of DVD Ram​
Verdich [7]

Answer:

Like ordinary random access memory (RAM), it can be repeatedly read, written to, and erased. Intended mostly for removable computer storage, DVD-RAM provides the capabilities of Rewriteable CD (CD-RW) - users can run programs from the discs, copy files to them and rewrite or delete them.

4 0
2 years ago
Read 2 more answers
What is the atomic number of neonWhat do the following results from the TEST FOR LIFE tab indicate about the sample
Scorpion4ik [409]
The atomic number for Neon is 10.

I do not see the info for the second part of the question
6 0
3 years ago
a_____________ may have its value change during program execution. options. flowchart,counter, Algorithm,None of them​
Amiraneli [1.4K]

Answer:

i think is "none of them"

5 0
3 years ago
Which of these steps comes first in the boot process
strojnjashka [21]

Answer:

Missing Reference

Explanation:

7 0
2 years ago
Other questions:
  • What would I need to make the perfect music video
    10·1 answer
  • Which subject area describes collecting and analyzing data from computer systems, networks, and storage devices, as part of an i
    7·1 answer
  • Read each statement below. If the statement describes a peer-to-peer network, put a P next to it. If the statement describes a s
    13·2 answers
  • Which term is used to describe a password-protected, encrypted data file that verifies the identity of the sender of a message?
    8·1 answer
  • Which of the following is most often added to safety glasses to provide better protection from impact and flying particles? A. S
    14·1 answer
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    14·1 answer
  • Hank is the network administrator responsible for managing the web server cluster for an e-commerce company. He’s worried about
    9·1 answer
  • A thermostat with the processor program to control temperature is an example of what kind of computer
    6·1 answer
  • he superclass Student contains: a constructor that accepts a String corresponding to the name of the school the student attends
    15·1 answer
  • What is 11x12x12x14x15x16
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!