stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Functions - Part 1 (2C) Flashcards | StudBud
Explore
/
Functions - Part 1 (2C)
Functions - Part 1 (2C)
5 terms
·
StudBud Administration
·
7 plays
Question about functions – part 1
Flashcards
5 cards
F
Practice quiz
P
Host live
L
Questions
5
Answers
1
Which of the following statements about '
return
' statement is true?
The function throws an error if there is no value specified with return.
The return statement is mandatory in every Python function.
The function immediately stops, and returns control to the caller.
A return statement can only be used once per function.
2
What is the purpose of a user-defined function in Python?
To declare variables within a program
To print statements to the console
To create reusable blocks of code to perform specific tasks
To perform mathematical operations only
3
Which keyword is used to define a function in Python?
define
def
function
func
4
What happens if a function in Python does not have a return statement?
It returns None implicitly
It automatically returns the input parameter
It terminates the program
It raises an error
5
What is the keyword used to return a value from a function in Python?
yield
None
giveback
return