Quiz on Python Loops
FREE Online Courses: Elevate Your Skills, Zero Cost Attached - Enroll Now!
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
-
Question 1 of 15
1. Question
- Which of the following does the for loop iterate on?
CorrectIncorrect -
Question 2 of 15
2. Question
- Find the true statement about the else used along with loops?
CorrectIncorrect -
Question 3 of 15
3. Question
- Which of the following is not a control statement in loops?
CorrectIncorrect -
Question 4 of 15
4. Question
What is the output of the following code?
n=5
while(n):
n=n-1
print(n,end=’ ‘)CorrectIncorrect -
Question 5 of 15
5. Question
What is the output of the following code?
list(range(-3,9,3))
CorrectIncorrect -
Question 6 of 15
6. Question
- What is the function of the continue statement?
CorrectIncorrect -
Question 7 of 15
7. Question
What is the output of the following code?
for i in range(5):
if(i%2):print(i,end=” “)CorrectIncorrect -
Question 8 of 15
8. Question
What is the output of the following code?
c=0
for i in ‘abc xyz’:
c=c+1
print(c)CorrectIncorrect -
Question 9 of 15
9. Question
- Which of the following does not give an empty set?
CorrectIncorrect -
Question 10 of 15
10. Question
What is the output of the following code?
list1=[1,2,3,4,5]
s=0
i=1
while(i in list1):
s=s+i
i=i+1
print(s,end=”)CorrectIncorrect -
Question 11 of 15
11. Question
How many times does the below code execute?
i=0
while (i<10):
if(i%2): i=i+3
i=i+1CorrectIncorrect -
Question 12 of 15
12. Question
What is the output of the following code?
for i in (‘a’,’b’,’c’,’d’):
print(i,end=”)
else:
print(‘end’)CorrectIncorrect -
Question 13 of 15
13. Question
- Which of the following is not true about the while loop?
CorrectIncorrect -
Question 14 of 15
14. Question
What is the output of the following code?
for i in range(1,6,2):
if (i==4):
break
print(i,end=” “)CorrectIncorrect -
Question 15 of 15
15. Question
Which of the following loops do not lead to infinite iterations?
a.
while(True):
print(‘Hi’)
b.
n=5
while(i<5):
print(i)
i=i-1
c.
a=2
while(i<3):
print(i)
CorrectIncorrect