stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Functions Flashcards | StudBud
Explore
/
Python Functions
Python Functions
15 terms
·
StudBud Administration
·
9 plays
Imported from external platform
Flashcards
15 cards
F
Practice quiz
P
Host live
L
Questions
15
Answers
1
What keyword is used to create a function?
return
func
def
function
2
A return statement ends the execution of a function call.
True
False
3
The return statement does not send data back to the function caller.
False
True
4
What would be stored in "result" after this function executes?
This code would result in an error.
30
43
13
5
Line 8 has no errors.
False
True
6
Arguments can be defined as...
Variables declared inside of a function.
Any value used in a function.
The variables defined in the function definition.
The values passed into the function when calling it.
7
What are the parameters in this function?
There are no parameters.
5, 6
result
x, y
8
Which of the following is a valid way to call this function?
def call_function("Here's a string", "Another string")
call_function("String 1", "String 2")
call_function()
def call_function()
9
Which variables are local and which are global?
Global: new_variable, final Local: variable, random
Global: random, new_variable, final Local: variable
Global: variable Local: random, new_variable, final
Global: variable, random Local: new_variable, final
10
What will print out in this function?
6
14
10
The word "total"
11
Which of the following is true about functions?
All of the above
They clean up your code.
They only run when they are called.
They are created with the def keyword.
12
What is the ERROR in this function?
value cannot be accessed because it is global.
You can't print function_fun() on line 8.
param2 cannot be returned, only printed.
There are less arguments than parameters.
13
What are the arguments in this function?
x, y
5, 6
There are no arguments.
result
14
What is a function?
A block of code that can only focus on mathematical operations.
A block of code that is only run when it is called.
A block of code that focuses on creating efficient use of memory.
Any block of code within a python file can be considered a function.
15
This type of variable is defined inside of a function and not accessible from outside.
Local
Int
Global
String