Calculating the number of all 1, 0 appears returns 0

#reply=input('How can I help you? ')
SIZE_1 DEF (m_grid):
    # 1 calculates a total number
    COUNT = 0
    for Row in Grid:
        for I in Row:
            IF I == 1:
                COUNT + 1 =
            the else:
                COUNT = 0
                BREAK
        IF COUNT == 0: outer layer # loop processing
            BREAK
        the else: # because there is no treatment so it can be omitted
            the Continue
    return COUNT

grid=[[1,1,1],[1,1,1]]
size=size_1(grid)
print(size)

Guess you like

Origin www.cnblogs.com/eleni/p/11221368.html