Python 3.x 尝试使用返回三个值的函数作为接受三个值的函数的输入

Python 3.x 尝试使用返回三个值的函数作为接受三个值的函数的输入,python-3.x,function,Python 3.x,Function,我有一个函数可以做一些事情,但最终返回三个列表。 我有另一个函数,一个类中的set方法,它接受三个输入。 当我尝试使用第一个函数作为set函数的参数时,它抱怨没有足够的输入,尽管它返回了正确的数量。有办法解决这个问题吗?我是否应该声明一些临时的局部变量来执行此操作 我的代码的简化版本 class hello(object): a, b, c = 0, 0, 0 def __init__(self, name): self.name = name def

我有一个函数可以做一些事情,但最终返回三个列表。 我有另一个函数,一个类中的set方法,它接受三个输入。 当我尝试使用第一个函数作为set函数的参数时,它抱怨没有足够的输入,尽管它返回了正确的数量。有办法解决这个问题吗?我是否应该声明一些临时的局部变量来执行此操作

我的代码的简化版本

class hello(object):
    a, b, c = 0, 0, 0
    def __init__(self, name):
        self.name = name

    def setThings(one, two, three):
        self.a = one
        self.b = two
        self.c = three

def someStuff(x, y, z):
    newX = x * 1337
    newY = y * 420
    newZ = z * 69
    return newX, newY, newZ

first = int(input("first"))
second = int(input("second"))
third = int(input("third"))
kenzi = hello(input("name pls"))
kenzi.setThings(someStuff(first, second, third))

将函数作为参数调用时,在函数前面添加一个asterix


kenzing.setThings(*something(first,second,third))

这比我预想的要简单得多。可惜的是,谷歌根本没有做到这一点。谢谢文档链接: