Debugging Python-dons';不要返回false

Debugging Python-dons';不要返回false,debugging,Debugging,我调试这个有困难,我有一个函数,它从以前的函数中提取了一些变量,我想太多了,不能发布在这里,但它们都按预期工作,并通过了项目自动mooshak测试,但是在一个函数的这个特定块上,我不能让它返回false 如果我在“调试器”上给它的参数满足给定的条件,但它不返回,它将打印('a')。你知道是什么引起的吗 编辑:这是我的全部功能 def ask_play(t): # Creates a string to be used on the input msg that follo

我调试这个有困难,我有一个函数,它从以前的函数中提取了一些变量,我想太多了,不能发布在这里,但它们都按预期工作,并通过了项目自动mooshak测试,但是在一个函数的这个特定块上,我不能让它返回false

如果我在“调试器”上给它的参数满足给定的条件,但它不返回,它将打印('a')。你知道是什么引起的吗

编辑:这是我的全部功能

    def ask_play(t):
        # Creates a string to be used on the input msg that follows the projet rulles, (coordenada_linha(etc...)) are the used to calculate the maximum dimensions of the board.

        dim = str('(') + str((coordenada_linha(tabuleiro_dimensoes(t)))) + str(' : ') + str((coordenada_coluna(tabuleiro_dimensoes(t)))) + str(')')

        # Creates the input message.
        msg = 'Introduza uma jogada\n - coordenada entre (1 : 1) e ' + str(dim) +' >> '

        # xy picks the inputed (x : y) from the input and turns into (x ,y) so we can compare them to the maximum and minimum accepted coordenates.
        xy = eval((input(msg)).replace(' : ' , ', '))

        # Valor is just the number the coordenate should recieve.
        valor = int(input(' - valor >> '))

        # maxdim is the "highest coordenate on the board" in this case it's (5, 5)    
        maxdim = (((coordenada_linha(tabuleiro_dimensoes(t)))), ((coordenada_coluna(tabuleiro_dimensoes(t)))))

        # checks if the first input is a coordenate that is "inside" the grid, if it isn't, SHOULD return false, else it returns coordenate + given value
        if not ((((xy) >= (1, 1)) and ((xy) <= (maxdim)))):
            return False
        else:
            return cria_jogada(cria_coordenada(coordenada_linha(xy), coordenada_coluna(xy)), valor)
def ask_play(t):
#创建一个字符串,用于在projet rulles之后的输入消息上使用,(coordenada_linha(等…)用于计算电路板的最大尺寸。
dim=str(‘(’)+str(‘(t)))+str(‘:’)+str(‘:’)+str(‘(t)))+str(‘)
#创建输入消息。
msg='introzaumajogada\n-coordenada entre(1:1)e'+str(dim)+'>'
#xy从输入中选取输入(x:y)并转换为(x,y),以便我们可以将它们与最大和最小接受坐标进行比较。
xy=eval((输入(消息))。替换(':',','))
#英勇只是合作者应该得到的数字。
valor=int(输入('-valor>>'))
#maxdim是“董事会上最高的合作伙伴”,在这种情况下,它是(5,5)
maxdim=((coordenada_linha(tabuleiro_dimensoes(t))),((coordenada_coluna(tabuleiro_dimensoes(t‘)’))
#检查第一个输入是否是“在”网格中的coordenate,如果不是,则应返回false,否则返回coordenate+给定值

如果没有(((xy)>=(1,1))和((xy)检查您的文本编辑器是否存在混合制表符和空格?这说明了我担心的问题

我猜是这样读的

if not ((((xy) >= (1, 1)) and ((xy) <= maxdim))):
....print('a')
> > return False

使其显示制表符和空格字符。如果某些行使用制表符和空格,请将它们更改为相同的--将制表符转换为空格。

复制它的功能,而不是返回?它不返回,只打印A,如果条件正常,则返回它应该返回的坐标元组,然后返回by该位置上的值。但当条件不正常时,我使用该条件,它只打印(a),我希望它说False,而不是使用print。函数必须返回某个值,对吗?运行“print ask\u play(某物)”的输出是什么'它通过麻烦路线的位置?没有吗?根据项目papper,返回应该是。如果坐标在网格内不可用-返回:False如果坐标在网格内可用-如果第一个输入(坐标)返回(x:y)-->值是无法转换为coordenate的字符串函数具有“无行为”ask_play Receives的输入参数是一个名为board的函数,该函数依次从txt文件接收信息。我不知道该怎么做?当我查看WingIDE、记事本++或记事本时,它不会显示任何wierd选项卡,就像您在示例中给出的,如果这是您所说的文本编辑器的意思的话。请注意,一切似乎都正常在这方面,我已经按照你的指示做了,但一切看起来都好像我没有激活“显示空白和选项卡”.我的意思是,我可以看到一些粉红色的小点,但显然一切都很好。我已经用整个功能更新了我的主要帖子,但是,我敢打赌,阅读那堵文字墙会让人很困惑。无论如何,谢谢你的帮助。
View->Show Symbol->Show White Space and Tab