python - function Flashcards

1
Q

void function

A

function that does not return value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

None indicate

A

no return statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

two kinds of arguments

A
  • positional
  • keyword
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

rules of arguments

A
  • can mix positional and keyword
  • positional arguments cannot appear after any keyword arguments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

keyword arguments

A
  • specify variable
  • passing each argument in the form name=value and can appear in any order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

arbitrary arguments

A
  • (*variable)
  • allow function accept variable number of arguments then convert it into tuple
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

local variable

A
  • variable created inside a function
  • can only be accessed within a function where its being created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

global variable

A
  • variable created outside all functions
  • accessible by all functions in their scope
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

recursive function

A

function that call upon itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly