
Python Functions Quiz
Authored by Christopher Maguire
Education
12th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a function in Python?
A way to print output to the screen
A block of reusable code that performs a specific task
A special type of variable
A type of loop
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to define a function in Python?
function
define
def
fn
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this code print? def greet(): print("Hello, world!") greet()
greet()
"Hello, world!"
Nothing, because the function is not called
An error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the return statement in a function?
It outputs data to the console
It stops the function execution
It sends a value back to where the function was called
It prints the function name
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this function return? def add(a, b): return a + b result = add(3, 5) print(result)
3
5
8
Nothing, because return does not print
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? def multiply(x, y=2): return x * y print(multiply(4))
4
2
8
An error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about function parameters and arguments?
Parameters are the actual values passed to a function
Arguments are the names defined in the function definition
Parameters are placeholders used in a function definition
Arguments and parameters are the same thing
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
15 questions
Social Etiquette quiz
Quiz
•
7th - 12th Grade
13 questions
Good Manners & Common Courtesy
Quiz
•
KG - Professional Dev...
10 questions
Basic Python
Quiz
•
10th Grade - University
10 questions
Types of Media
Quiz
•
12th Grade
12 questions
M2 Social Engineering, Camb Nats
Quiz
•
9th - 12th Grade
10 questions
Interviewing Skills
Quiz
•
12th Grade
12 questions
Nirmala School quiz
Quiz
•
9th - 12th Grade
15 questions
Theatre Collaboration and Ensemble Review
Quiz
•
12th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade