Python:从其他函数返回的函数调用函数

时间:2018-12-01 22:16:47

标签: python

我有两个函数,我想一个接一个地调用。从第一个返回的应该是第二个的参数。 我找不到办法。

BOARD= [[0]*10]*10

def right (board , start, n):
    board[start[0]]= [0]*start[1] + [1]*(n-start[1])
    endpoint= [start[0], start[1]+n]
    return board , endpoint , n

def down (board, start, n): 
    for j in range (1,n ):
        board[start[1]+j][start[0]]= 1
        endpoint= [start[0]+n, start[1]]
    return board , endpoint , n

# the call 
down(right(BOARD, [0,0],10))

错误为: TypeError:down()缺少2个必需的位置参数:“开始”和“ n” *

如果有人有主意请.... 预先谢谢您:)

0 个答案:

没有答案
相关问题