Functions Flashcards

1
Q

Function

A

Named series of statements
Can be built-in or created by programmer
Can be used in an assignment statement

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

Function Definition

A

Consists of def keyword, function’s name, and block of statements

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

Block

A

Series of indented statements following the function definition

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

Return

A

Returns execution to the next statement after the call

Function only return one item (which could be be a tuple or list)

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

Parameter

A

Input to a function that influence’s its behavior

Cannot be an expression

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

Argument

A

Value passed to a parameter

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

Hierarchical Function Call

A

Function argument provided by user input

aka Nested Function Call

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

Polymorphism

A

A function can perform the same action on different data types
Inherent part of Python language

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

Dynamic Typing

A

Interpreter determines type of objects as program executes

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

Static Typing

A

Requires programmer to define the type of every variable

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

Function Stubs

A

Function definitions without statements

Used in incremental programming

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

Pass

A

Keyword that acts as placeholder for a required statement in a function stub

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

Local Variables

A

Variables that are only visible inside the scope of a function

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

Global Variable

A

Variables defined outside of a function

Can also be accessed within functions

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

Global Statement

A

Modifies the value of a global variable from within a function

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

Pass-by-Assignment

A

New local variables created in function’s local namespace by binding names in parameter list to passed arguments

17
Q

Docstring

A

Starts and ends with three quotation marks
Used to provide function and argument description
“"”This function is for”””