
Mastering Python Basics
Authored by Sakthivel Duraisamy
Computers
12th Grade
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for a for loop in Python?
for variable in sequence[]
for (variable : sequence)
for variable in (sequence)
for variable in sequence:
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you iterate over a list using a for loop?
foreach item in my_list:
for each item in my_list:
for item in list my_list:
for item in my_list:
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: for i in range(5): print(i)?
0 1 2 3 4
-1
10
5
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create an infinite while loop in Python?
while True:
while False:
while 1:
while x < 10:
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a while loop and a for loop?
A while loop is always faster than a for loop.
A for loop can only iterate over arrays, while a while loop can iterate over any data type.
A while loop requires a counter variable, while a for loop does not.
A while loop checks the condition before each iteration, while a for loop is used for a specific number of iterations with initialization and increment.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you break out of a while loop?
Use the 'continue' statement.
Remove the loop condition.
Use the 'break' statement.
Add a return statement.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the continue statement in a loop?
The continue statement restarts the loop from the beginning.
The continue statement ends the loop immediately.
The continue statement pauses the loop for a specified time.
The continue statement skips the current iteration of a loop.
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
Name The Disney Animation Films
Quiz
•
KG - University
15 questions
Empowerment Technologies
Quiz
•
KG - 12th Grade
15 questions
Excel
Quiz
•
10th - 12th Grade
20 questions
Clean, Sanitize and Store Kitchen Tools and Equipment
Quiz
•
11th - 12th Grade
18 questions
12AIT - All About W3C <3
Quiz
•
10th Grade - University
16 questions
AI Checkpoint 1 Revision
Quiz
•
9th - 12th Grade
15 questions
Cyber Security KS4
Quiz
•
8th - 12th Grade
15 questions
Linux-2 Quiz 2 -- LAMP
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade