
Mastering Python Loops and Functions
Quiz
•
Computers
•
10th Grade
•
Easy
JAYA SUDIKSHA
Used 1+ times
FREE Resource
Enhance your content
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the syntax for a for loop in Python?
for variable in sequence:
for (variable; condition; increment)
for each variable in sequence:
foreach variable in sequence:
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you iterate over a list using a for loop?
for each item in my_list:
foreach item in my_list:
for item in my_list:
for item in list my_list:
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What keyword is used to define a function in Python?
def
function
define
method
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code: for i in range(5): print(i)?
5
-1
0 1 2 3 4
10
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is a valid datatype in Python: int, float, string, all of the above?
boolean
dictionary
all of the above
list
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What keyword is used to exit a loop prematurely?
continue
exit
return
break
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you define a function that takes parameters in Python?
function_name(parameter1, parameter2) =>
function_name: parameter1, parameter2
function_name(parameter1; parameter2)
def function_name(parameter1, parameter2):
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
21 questions
Python Concepts Quiz
Quiz
•
11th Grade
20 questions
12 CSC ATAR - programming skills and concepts
Quiz
•
12th Grade
16 questions
Python U2M3 Test
Quiz
•
9th - 12th Grade
20 questions
Python Programming II CSE A
Quiz
•
12th Grade - University
25 questions
PYTHON CONTEST 2
Quiz
•
University
15 questions
PYTHON PROGRAMMING
Quiz
•
11th - 12th Grade
25 questions
Python
Quiz
•
11th Grade
20 questions
PY-BUILD
Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade