
Python Functions

Quiz
•
Mathematics
•
12th Grade
•
Medium

Jérome Simon
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to define a function in Python?
function my_function():
def my_function():
create my_function():
function: my_function()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call (use) a function named greet in Python?
call greet()
greet()
function greet()
greet
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following function return?
The sum of x and y
x
y
Nothing
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to define a function with two parameters in Python?
def multiply(x, y):
def multiply: x, y
def multiply(x y):
def multiply - x, y:
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following function do?
Prints the message once
Prints the message twice
Causes a syntax error
Nothing
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
5
10
x*2
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about the scope of variables in functions?
Variables defined inside a function are accessible from anywhere in the program.
Variables defined outside a function are not accessible inside the function.
Variables defined inside a function are only accessible within the function.
Variables cannot be defined inside functions.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Graphing a Function Intervals

Quiz
•
11th Grade - University
20 questions
Analyze Real-World Functional Relationships

Quiz
•
7th Grade - University
16 questions
Identify the Inequality

Quiz
•
10th Grade - University
12 questions
Python Basics

Quiz
•
8th - 12th Grade
20 questions
Semester 1 Vocabulary Quiz

Quiz
•
9th - 12th Grade
20 questions
Scatter Plots and Association

Quiz
•
9th - 12th Grade
20 questions
Polynomial Definition

Quiz
•
10th Grade - University
20 questions
Linear Functions STAAR Review

Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Mathematics
20 questions
Parallel lines and transversals

Quiz
•
9th - 12th Grade
9 questions
Geometry and Trigonometry Concepts

Interactive video
•
9th - 12th Grade
10 questions
Angle Relationships with Parallel Lines and a Transversal

Quiz
•
9th - 12th Grade
10 questions
Intro to Parallel and Perpendicular Slopes

Quiz
•
9th - 12th Grade
15 questions
Intro To Compound Inequalities

Quiz
•
9th - 12th Grade
16 questions
Deductive Reasoning - Law of Detachment & Syllogism

Quiz
•
9th - 12th Grade
20 questions
Solving Absolute Value Equations

Quiz
•
11th - 12th Grade
46 questions
QPA Review #1

Quiz
•
9th - 12th Grade