3 ms·
Throw it in a function and return early: found = findIt(search_query, table.rows, logger) def findIt(query, rows, logger): for r, row in enumerate(row
by dotancohen 4y ago
Throw it in a function and return early:
found = findIt(search_query, table.rows, logger)
def findIt(query, rows, logger):
for r, row in enumerate(rows):
for c, cell in enumerate(row):
if query.matches(cell.value):
logger.log("Found cell: {}".format(found))
return (r, c)
break 2
return None