← Back to Lists
Question 150
Row Totals By Hand
Row Totals By Hand
The grid matrix has three rows of three integers: declare the first two rows as [3, 8, 1] and [7, 2, 9], and read the three values of the last row from input(), one per line with no prompts. Using a for loop over the rows and a second for loop inside it over the values of each row, add up each row by hand (no sum()) and print Row total: <n> for every row in order, then print Grand total: <n> once, the sum of all nine values, accumulated in a variable called grand_total. Input: three integers.
Expected Output:
Row total: 12 Row total: 18 Row total: 15 Grand total: 45
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Lists
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.