
Mastering Python Basics

Quiz
•
Computers
•
12th Grade
•
Medium
Sakthivel Duraisamy
Used 5+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
TN +2 -LESSON1 FUNCTIONS

Quiz
•
12th Grade
15 questions
python basics quiz

Quiz
•
9th - 12th Grade
16 questions
Python programming

Quiz
•
6th - 12th Grade
25 questions
COMP SCI (FUNCTIONS)

Quiz
•
12th Grade
20 questions
Python 3 Review Part 1

Quiz
•
9th - 12th Grade
20 questions
Defined Functions

Quiz
•
12th Grade
19 questions
Python Print Function Quiz

Quiz
•
12th Grade
20 questions
Subroutines - Procedures & Functions

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Computers
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
20 questions
Lab Safety and Lab Equipment

Quiz
•
9th - 12th Grade
7 questions
EAHS PBIS Lesson- Bathroom

Lesson
•
9th - 12th Grade
57 questions
How well do YOU know Neuwirth?

Quiz
•
9th - 12th Grade
20 questions
Getting to know YOU icebreaker activity!

Quiz
•
6th - 12th Grade
6 questions
Secondary Safety Quiz

Lesson
•
9th - 12th Grade
4 questions
Study Skills

Lesson
•
5th - 12th Grade
15 questions
Let's Take a Poll...

Quiz
•
9th Grade - University