asked 222k views
3 votes
Question 11 Which one of the following is an infinite loop?

A. for i in range(-1):
print(i)
B. X=10
while x <= 10:
x=x-1
print (x)
C. for I in range (10):
print (I -10)
D. none of the above


asked
User Floremin
by
8.7k points

1 Answer

6 votes

Answer:

B.

x=10

while x <= 10:

x=x-1

Step-by-step explanation:

Since x starts at 10 and keeps decreasing, its value will be always less than 10 so the loop will never end

answered
User Shane Voisard
by
8.8k points

No related questions found