0

I have a function that takes in 3 parameters, and I have a list that contains 3 arguments.

I want to use this list as the function's parameter, how do I do it?

for example:

def get_result(x, y, z):
    'do_something'
vlist = [1,2,3]
get_result(vlist)
Alex
  • 13
  • 1

1 Answers1

-1

Unpack using the * 'splat' operator -> get_result(*vlist)

kmario23
  • 57,311
  • 13
  • 161
  • 150
ospahiu
  • 3,465
  • 2
  • 13
  • 24