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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!