a.
11. Consider the following loop:
(1)
j=10
while j>=5:
print(“X”)
j=j-1
Which of the following for loop will generate the same output as the loop shown previously?
for j in range(-1,-5,-1):
print(“X”)
b. for j in range(0,5):
print(“X”)
c. for j in range(10,-1,-2):
print(“X”)
d. for j in range(10,5,-1):
print(“X”)
Answers
Answered by
1
Answer:
I think the output of the first syntax will be '5'
according to this,
option ( b. for j in range(0,5):
print(“X”) )
is the right answer.
hope it helped.
Similar questions
Computer Science,
2 months ago
Chemistry,
2 months ago
Math,
2 months ago
Computer Science,
4 months ago
English,
4 months ago
Social Sciences,
10 months ago
Geography,
10 months ago
English,
10 months ago