<filename>How_to_manage_data/symmetric.py
# A list is symmetric if the first row is the same as the first column,
# the second row is the same as the second column and so on. Write a
# procedure, symmetric, which takes a list as input, and returns the
# boolean True if the list is symmetric and False if it is not.
def symmetric(caja):
    vacio = len(caja)

    if not vacio:
        return False

    if vacio != len(caja[0]):
        return False

    i = 0
    while i < vacio:
        j = 0
        while j < vacio:
            if caja[i][j] != caja[j][i]:
                return False
            j = j + 1 # close the loop
        i = i + 1 # close the loop
    return True



print (symmetric([[1, 2, 3],
                [2, 3, 4],
                [3, 4, 1]]))

#>>> True

#print symmetric([["cat", "dog", "fish"],
#                ["dog", "dog", "fish"],
#                ["fish", "fish", "cat"]])
#>>> True

#print symmetric([["cat", "dog", "fish"],
#                ["dog", "dog", "dog"],
#                ["fish","fish","cat"]])
#>>> False

#print symmetric([[1, 2],
#                [2, 1]])
#>>> True

print (symmetric([[1, 2, 3, 4],
                [2, 3, 4, 5],
                [3, 4, 5, 6]]))
#>>> False

#print symmetric([[1,2,3],
#                 [2,3,1]])
#>>> False

<filename>How_to_manage_data/symmetric.py
# A list is symmetric if the first row is the same as the first column,
# the second row is the same as the second column and so on. Write a
# procedure, symmetric, which takes a list as input, and returns the
# boolean True if the list is symmetric and False if it is not.
def symmetric(caja):
    vacio = len(caja)

    if not vacio:
        return False

    if vacio != len(caja[0]):
        return False

    i = 0
    while i < vacio:
        j = 0
        while j < vacio:
            if caja[i][j] != caja[j][i]:
                return False
            j = j + 1 # close the loop
        i = i + 1 # close the loop
    return True



print (symmetric([[1, 2, 3],
                [2, 3, 4],
                [3, 4, 1]]))

#>>> True

#print symmetric([["cat", "dog", "fish"],
#                ["dog", "dog", "fish"],
#                ["fish", "fish", "cat"]])
#>>> True

#print symmetric([["cat", "dog", "fish"],
#                ["dog", "dog", "dog"],
#                ["fish","fish","cat"]])
#>>> False

#print symmetric([[1, 2],
#                [2, 1]])
#>>> True

print (symmetric([[1, 2, 3, 4],
                [2, 3, 4, 5],
                [3, 4, 5, 6]]))
#>>> False

#print symmetric([[1,2,3],
#                 [2,3,1]])
#>>> False

# A list is symmetric if the first row is the same as the first column, # the second row is the same as the second column and so on. Write a # procedure, symmetric, which takes a list as input, and returns the # boolean True if the list is symmetric and False if it is not. # close the loop # close the loop #>>> True #print symmetric([["cat", "dog", "fish"], #                ["dog", "dog", "fish"], #                ["fish", "fish", "cat"]]) #>>> True #print symmetric([["cat", "dog", "fish"], #                ["dog", "dog", "dog"], #                ["fish","fish","cat"]]) #>>> False #print symmetric([[1, 2], #                [2, 1]]) #>>> True #>>> False #print symmetric([[1,2,3], #                 [2,3,1]]) #>>> False