Skip to content
Intern–Middle164 views

Function to double an arbitrary set of numbers

Task condition

Create a function capable of accepting any number of numerical arguments and returning an array where each element is multiplied by two. The number of input values is not limited.

def double_all(*values):
    return [v * 2 for v in values]
Frontend tasks in the code trainer