
Python Functions and Modules Quiz

Quiz
•
Science
•
12th Grade
•
Hard
S.KINGSLEY CSE
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a function in Python?
A way to handle exceptions
A method to create loops
A block of code that performs a specific task
A type of variable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a function in Python?
define greet():
create greet():
def greet():
function greet():
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of greet('John') if greet is defined as def greet(name): print('Hello', name)?
Hello World
John
Hello John
Hello
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the asterisk (*) in function definitions?
To denote a global variable
To indicate a local variable
To allow arbitrary arguments
To create a loop
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of variable is created inside a function?
Nonlocal variable
Local variable
Static variable
Global variable
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is recursion in programming?
A function calling itself
A method to repeat a function
A type of loop
A way to handle errors
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the math module provide?
Network communication tools
File handling methods
Mathematical functions and constants
String manipulation functions
Create a free account and access millions of resources
Similar Resources on Wayground
18 questions
Analyzing Data

Quiz
•
9th - 12th Grade
15 questions
Biology Leap Test

Quiz
•
12th Grade - University
15 questions
Variable Identification

Quiz
•
9th - 12th Grade
15 questions
PLC

Quiz
•
12th Grade - University
15 questions
HVAC Motors

Quiz
•
8th Grade - University
15 questions
Magnets and Bluetooth Speaker

Quiz
•
6th Grade - University
9 questions
Algebra 1 Unit 3 Vocabulary

Quiz
•
9th - 12th Grade
18 questions
Scientific Investigation

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade