def countpaths(row, column):
    result = [([1] * column) for r in range(row)]
for r in range(1, row):
    for c in range(1, column):
        result[r][c] = result[r][c - 1] + result[r - 1][c]
return result
paths = countpaths(3, 7)
for r in paths:
    print(r)
print(paths[0][0])
print(paths[2][6])
counting paths for a given situation