Computer Science
Which of the following code segments contain an example of a nested loop?
- for i in range(10): <br/> print(i) <br/>for j in range(10): <br/> print(j)
- for i in range(10): <br/> print(i) <br/> for j in range(10): <br/> print(j)
- for i in range(10): <br/> print(i) <br/> while i < 20: <br/> print(i) <br/> i = i + 1
- for i in range(10): <br/> print(i) <br/>while i < 20: <br/> print(i)
Python Control Flow
2 Likes
Answer
for i in range(10): <br/> print(i) <br/> for j in range(10): <br/> print(j)
for i in range(10): <br/> print(i) <br/> while i < 20: <br/> print(i) <br/> i = i + 1
Answered By
2 Likes
Related Questions
Consider the following loop:
j = 10 while j >= 5: print("X") j=j-1Which of the following for loops will generate the same output as the loop shown previously?
What is the output produced when this code executes?
a = 0 for i in range(4,8): if i % 2 == 0: a = a + i print (a)Fill in the blanks:
The _________ statement forms the selection construct in Python.
Fill in the blanks:
The _________ statement is a do nothing statement in Python.