HardKore3491 HardKore3491
  • 18-12-2020
  • Computers and Technology
contestada

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

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 20-12-2020

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.

Answer Link

Otras preguntas

Over time, a shallow pond fills with plants, such as duckweed and cattails. These plants- A:will die off quickly in the shallow water. B:support ecological suc
do you think what this person is saying is right
Choose the correct response. ¿Van Uds. a pagar la cuenta? * A. Si, vamos a pagan la cue to B. Si, vamos a pagamos la cuenta
6. What term describes a liquid changing to a gas? A. Deposition B. Sublimation C. Freezing D. Evaporation
What height in meters must the student climb in order to reach the top of the hill?
it is raining is a phrase or clause?​
What did the ancient Greeks think about the world? a. They thought it was too close to the Sun b. They thought there weren't enough trees c. They thought it was
Examine the diagram of a cell. Which accurately labels the cytoplasm?
Help pleaseeeeeeeeeeee.
Which of the following best describes refraction?