Python - Algorithm to determine if a list is symmetric

前端 未结 6 1651
灰色年华
灰色年华 2021-01-22 00:01

So I\'m stuck on this problem where I\'ve been asked to write an function in Python that checks to see if an n-dimensional array (is that what they\'re called?) is \"symmetric\"

6条回答
  •  失恋的感觉
    2021-01-22 00:44

    Value y = 0 should be inside the first while loop. Like this:

    def symmetric(square):
        final_result = []
        x = 0
        while x < len(square):
             y = 0
            row_list = []
            .
            .
    

提交回复
热议问题