I am getting an array of values and I want to send them to a predefined function with the same parameter count.
The naive way is to do:
values = [1,2,3,4] # getting it from outside
if len(values) == 1:
func(values[0])
elif len(values) == 2:
func(values[0], values[1])
.
.
.
is there more elegant way ?
func(values)?