One method to calculate the sum of each row using only for loops and if statements (excluding the use of sum function and numpy) is:
- Create an empty list to store the sums of each row
- Use a for loop to iterate through each row
- Initialize a variable to store the sum of the current row
- Use another for loop to iterate through each element in the current row
- Add each element to the sum variable
- Append the sum variable to the list of row sums
- Move on to the next row and repeat steps 3-6
- After iterating through all rows, the list of row sums should have the sum of each row.