小编Qin*_*ang的帖子

使用功能1的输出作为功能2的输入

所以我有一些代码如下:

def _step_1(a, b, c):
    some codes
    return d, e, f

def _step_2(d, e, f, a, b):
    some codes
    return g

def _run_all(a, b, c):
    g = _step_2(_step_1(a, b, c), a, b)
    return g
Run Code Online (Sandbox Code Playgroud)

它告诉我,我错过了两个参数"a"和"b".有人可以通过尝试保存一些步骤告诉我是否做错了什么吗?或者没有办法保存步骤?我知道我绝对可以这样写:

def _run_all(a, b, c):
    d, e, f = _step_1(a, b, c)
    g = _step_2(d, e, f, a, b)
    return g
Run Code Online (Sandbox Code Playgroud)

python function user-defined-functions

3
推荐指数
1
解决办法
34
查看次数

标签 统计

function ×1

python ×1

user-defined-functions ×1