Question: 1. The following simple exercise will help you understand loops better. Show the output of each of the following pairs of for loops. The first
1. The following simple exercise will help you understand loops better. Show the output of each of the following pairs of for loops. The first two pairs are nested loops, and the third pair is formed by consecutive, or sequential, loops. Submit a single text file containing three lines, each with an integer on it. # Version 1 total- 0 for i in range (10): for j in range (10): total 1 print (total) # Version 2 total 0 for i in range(10): for j in range(i 1, 10): total 1 print (total) # Version 3 total 0 for i in range (10): total += 1 for j in range (10): total +1 print (total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
