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

HURRY An ultrasound tech is trying to identify an object, but the screen of the machine is broken. Which statement best describes this situation? The generated
hellllllllpppppppp meeeeeeeee pkzzzzzzzzz I am in quiz and explain a bit plzzzzzzz​
Find the slope of the line that contains (-2,-2) and (-10,-9). A. M=8/7 B. M=11/12 C. M=12/11 D. M=7/8
In what ways does hip hop reflect what is going on in society?
  Will give brainliest!!! Use ten (10) words from the vocabulary list. Your sentences may be about anything so long as it is appropriate.The sentences must ma
please help me with this math problem ​
Which of the following BEST explains the significance of the Miranda v. Arizona trial of 1966?
What is the current and power in a 120V circuit if the resistance 5Ω?
LARGEST to SMALLEST chromosome Cell Nucleotide DNA Nucleus
make an equation of a line with the points (4,5) and (7,-1)