CJCoding With Joseph
15free / daySign inCreate account

Grid Total

Four whole numbers are read, one per line, into a 2 by 2 grid declared as a list of lists (the first two lines make the first row). Use nested for loops: the outer loop takes one row at a time and the inner loop adds that row's values into a row total, which is printed as Row total: <value> before the next row starts; afterwards print the sum of everything as Grid total: <value>. Input: four integers, no prompts.

Expected Output:

Row total: 7
Row total: 11
Grid total: 18

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Loops
📥 Auto-Input:
3\n4\n5\n6\n
This input is automatically fed to your program's stdin
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.