谁能解释给我'def displayRMagicSquare(magic_square)'到底要什么?

问题描述 投票:-1回答:1

请检查下面的代码,我只是想了解问题(第二个函数)到底要什么????

def createRMagicSquare(row1,row2,row3,row4):
    magic_square = [row1,row2,row3,row4]
    for i in magic_square:
    print(” “.join(map(str,i)))
    return magic_square

def displayRMagicSquare(magic_square):
   ## START CODE HERE
   ????????????????????????????????????????????????  # What shall I write here??
   ## END CODE HERE

c = createRMagicSquare([23, 22, 18 ,87], [89, 27, 9 ,25] , [90, 24 ,89 ,16] , [19, 46 ,23 ,11])

displayRMagicSquare(c)

现在我的问题是,'defRMagicSquare(magic_square)'函数到底要求什么?

我已经在'def createRMagicSquare(row1,row2,row3,row4)'中编写了完整的代码,但为了达到预期的输出,我将在第二个函数中编写什么内容?

创建和显示之间的实际区别是什么,显示等于打印还是返回????

预期输出---] >>

23 22 18 87
89 27 9 25
90 24 89 16
19 46 23 11

请帮助!

请检查下面的代码,我只是想了解问题(第二个函数)到底要什么???? def createRMagicSquare(row1,row2,row3,row4):magic_square = [row1,row2,row3,...

python-3.x function
1个回答
0
投票

您正在createRMagicSquare()中实现预期的输出,我认为不需要displayRMagicSquare()

© www.soinside.com 2019 - 2024. All rights reserved.