Rewrite the following code to use two while loops in place of the two for loops: def sum_upper_triangle(matrix): sum_val
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Rewrite the following code to use two while loops in place of the two for loops: def sum_upper_triangle(matrix): sum_val
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!