python - function Flashcards
1
Q
void function
A
function that does not return value
2
Q
None indicate
A
no return statement
3
Q
two kinds of arguments
A
- positional
- keyword
4
Q
rules of arguments
A
- can mix positional and keyword
- positional arguments cannot appear after any keyword arguments
5
Q
positional arguments
A
- based on position
- requires the arguments to be passed in the same order as their respective parameters in the function definition header
6
Q
keyword arguments
A
- specify variable
- passing each argument in the form name=value and can appear in any order
7
Q
arbitrary arguments
A
- (*variable)
- allow function accept variable number of arguments then convert it into tuple
8
Q
local variable
A
- variable created inside a function
- can only be accessed within a function where its being created
9
Q
global variable
A
- variable created outside all functions
- accessible by all functions in their scope
10
Q
a local variable could be bind in the global scope or
a variable in a function can be use outside the function
by using
A
global statement
11
Q
recursive function
A
function that call upon itself