Page 1 of 1

Rewrite the following code to use two while loops in place of the two for loops: def sum_upper_triangle(matrix): sum_val

Posted: Mon Jun 06, 2022 6:30 pm
by answerhappygod
Rewrite The Following Code To Use Two While Loops In Place Of The Two For Loops Def Sum Upper Triangle Matrix Sum Val 1
Rewrite The Following Code To Use Two While Loops In Place Of The Two For Loops Def Sum Upper Triangle Matrix Sum Val 1 (33.57 KiB) Viewed 21 times
Rewrite the following code to use two while loops in place of the two for loops: def sum_upper_triangle(matrix): sum_val = 0 for i in range (len(matrix)): for j in range(i, len(matrix)): sum_val += matrix[j] return sum_val