
TECH TITAN
Authored by Praveen Mishra
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following loops is used for definite iteration?
a) while loop
b) for loop
c) repeat loop
d) if loop
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the key difference between a "while" loop and a "for" loop in Python?
"for" loops can have a condition, while "while" loops cannot.
"while" loops are used for counting, while "for" loops are used for indefinite iterations.
"for" loops can only iterate over lists, while "while" loops can iterate over any data type.
"for" loops specify the iteration variable explicitly, while "while" loops do not.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following code?
x = 5
while x > 0:
print(x)
x -= 1
else:
print("Loop finished.")
5 4 3 2 1
5 4 3 2 1 Loop finished.
1 2 3 4 5
Loop finished.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the following code?
for i in range(1,6+1):
print(i)
1234567
1234567+1
7654321+1
123456
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
How can you prevent an infinite loop in Python?
By using the "break" statement.
By ensuring the loop condition becomes False at some point.
By using the "continue" statement.
By using the "pass" statement.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
x = 5
while x > 0:
x -= 1
print(x)
What will be the output of the code snippet above?
5
4
1
0
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following code snippets will correctly print all the even numbers from 2 to 10 using a loop in Python?
for i in range(2, 11):
if i % 2 == 0:
print(i)
num = 2
while num <= 10:
if num % 2 == 0:
print(num)
num += 2
for i in range(2, 11, 2):
print(i)
num = 2
while num < 10:
if num % 2 == 0:
print(num)
num += 1
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Mayer Çoklu Ortam Tasarımı İlkeleri
Quiz
•
Professional Development
20 questions
On-tap-chu-de-C
Quiz
•
6th Grade
20 questions
PENILAIAN HARIAN MATERI EKOLOGI DAN KEANEKARAGAMAN HAYATI
Quiz
•
7th Grade
20 questions
Pointers
Quiz
•
12th Grade
20 questions
Electricity and Magnetism
Quiz
•
5th Grade
20 questions
Ting 3 BAB 1 Aplikasi Teknologi
Quiz
•
1st Grade
20 questions
ANINS
Quiz
•
University
20 questions
TPS (Prediksi)
Quiz
•
12th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade