
Section 4A: Decompose the code using functions
Authored by Misti McDaniel
Computers
12th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used in Python to define a user-defined function?
function
def
func
define
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default return value of a function in Python if there is no return statement?
0
None
False
""
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to invoke a function named `greet`?
call greet
greet()
greet
invoke greet
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the `return` keyword do in a Python function?
Exits the program
Exits the function and optionally passes back a value
Prints a value to the screen
Continues to the next iteration
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes a generator in Python?
A function that returns a list
A function that uses `yield` to produce a sequence of values
A function that only prints values
A function that returns None
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following code, what will be printed? def foo(): pass print(foo())
0
None
foo
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about recursion is TRUE?
A recursive function must always have a base case.
Recursive functions cannot call themselves.
Recursion is only possible with integers.
Recursion is not allowed in Python.
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
14 questions
Bài 29. Nhận biết lỗi chương trình
Quiz
•
9th - 12th Grade
10 questions
PF Unit 10
Quiz
•
9th Grade - University
10 questions
If-Statements
Quiz
•
9th - 12th Grade
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
15 questions
The Genius of Alan Turing
Quiz
•
10th Grade - University
15 questions
ONLINE Quiz - Computer Hardware Basics (COMSYS 1)
Quiz
•
12th Grade
13 questions
Topic 1: SKEE1103
Quiz
•
12th Grade
10 questions
12 CA One Mark 1-5
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade