Question: def calculate_str_index(N_ROWS: int, N_COLUMNS: int) -> int: Return ROWS and COLUMNS to str_index as the formula (row - 1) * N_COLUMNS + (col -
def calculate_str_index(N_ROWS: int, N_COLUMNS: int) -> int: """ Return ROWS and COLUMNS to str_index as the formula (row - 1) * N_COLUMNS + (col - 1) >>>calculate_str_index(1,1) 0 >>>calculate_str_index(1,2) 1 """ return (N_ROWS - 1) * N_COLUMNS + (N_COLUMNS - 1)
why its always get syntaxerror: 'return' outside function for any case i test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
