Chapter 4 - Creating Functions Flashcards

1
Q

Keyword

A

Name given to words that have special meanings

Generally, these words cannot be used as variable or function names

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

def

A

Defining a function in Python

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

Parameters

A

Variables that get their value from the arguments within a function call

How function refers to inputs

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

return

A

Keyword ‘return’ followed by an expression that returns the value for the function

One way of getting data out of a function

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

Scope

A

Variables defined within a function only exist in said function

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

Function Input

A

Arguments of a function call assigned to function parameters

Function “takes” an input

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

Function Output

A

Returned from data created within a function

Function “returns” data

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

Docstrings

A

Describing what a function does, what each parameter is for, the expected data type and what the function returns

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

Generalization of Functions

A

Modifying a function that solves a specific problem, so that it can solve a wide array of problems

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

Cohesion

A

Functions that perform one well-defined task

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