1 Crore+ students have signed up on EduRev. Have you? Download the App |
What is the difference between break and continue statements in Python loops?
Which loop in Python allows you to execute a block of code as long as a condition is true?
What is the output of the following code snippet?
for i in range(5):
if i == 2:
break
print(i)
What is the output of the following code snippet?
while True:
print("Hello")
break
print("World")
What is the output of the following code snippet?
x = 5
while x > 0:
print(x)
x -= 1
What is the output of the following code snippet?
for i in range(1, 6):
print(i, end=" ")
if i == 3:
break
What is the output of the following code snippet?
for i in range(1, 6):
if i == 3:
continue
print(i, end=" ")
What is the output of the following code snippet?
for i in range(3):
for j in range(3):
if j == 1:
break
print(i, j)
What is the output of the following code snippet?
for i in range(3):
for j in range(3):
if j == 1:
continue
print(i, j)
What is the output of the following code snippet?
for i in range(5):
if i == 3:
pass
print(i, end=" ")
What is the output of the following code snippet?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print("Finished")
What is the output of the following code snippet?
for i in range(5):
if i == 3:
break
print(i)
else:
print("Finished")
What will be the output of the following code snippet?
for i in range(5):
if i == 2:
pass
print(i, end=" ")
else:
print("Done")
What will be the output of the following code snippet?
for i in range(5):
if i == 2:
break
print(i, end=" ")
else:
print("Done")