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

3. 500,000 C of charge flows in 1 hour?
what is your opinion about the upcoming presidential election be specific​
given the function f(x)=x^2+9 find f(x-2)
Over 100 existing elements are listed and classified on the ____________________.
why entrepreneur is made​
guys this is really urgentA bag of cement lying in the open gets wet due to rain during the night. The next day the sun shine shines brightly. Do you think the
I need to find the value to m
a short story containing the word colony, agriculture, cash crops, merchants, and economy.
if a creature dies without reproducing, how can it help transfer its genes to the next generation? (3-5 sentences please!)
A key element of the Fourth Amendment is that searches and seizures must be conducted only if a serious crime has been committed. with compassion and support. u