logo CodeStepByStep logo

double_list

Language/Type: Python functional programming lists collections

Write a function named double_list that takes a list as a parameter and returns a list of integers that contains double the elements in the initial list. For example, if the initial list is [2, -1, 4, 16], you should return [4, -2, 8, 32].

Use Python's functional programming constructs, such as list comprehensions, map, filter, reduce, to implement your function. Do not use any loops or recursion in your solution.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.