TAMU ENGR 102 (python coding) questions with
Complete Solutions |100% Pass
what is the for loop designed to do? - ✔✔to perform specific statements for a
determined number of iterations
sum = 0
for i in range(10):
sum += i+1
print(sum) - ✔✔55
what are nesting loops? - ✔✔that is when you nest one loop inside another
for i in range(3):
print("i is", i)
, for j in range(3):
print(" j is", j)
break - ✔✔i is 0
j is 0
i is 1
j is 0
i is 2
j is 0
what does the "break" statement do? - ✔✔it immediately stops that iteration in the loop!
for i in range(10):
if i%2 == 1:
continue
print("i is", i) - ✔✔i is 0
i is 2
i is 4
i is 6
i is 8
grades = [87, 93, 75, 100, 82, 91, 85]
Complete Solutions |100% Pass
what is the for loop designed to do? - ✔✔to perform specific statements for a
determined number of iterations
sum = 0
for i in range(10):
sum += i+1
print(sum) - ✔✔55
what are nesting loops? - ✔✔that is when you nest one loop inside another
for i in range(3):
print("i is", i)
, for j in range(3):
print(" j is", j)
break - ✔✔i is 0
j is 0
i is 1
j is 0
i is 2
j is 0
what does the "break" statement do? - ✔✔it immediately stops that iteration in the loop!
for i in range(10):
if i%2 == 1:
continue
print("i is", i) - ✔✔i is 0
i is 2
i is 4
i is 6
i is 8
grades = [87, 93, 75, 100, 82, 91, 85]