6 Functions Flashcards
1
Q
Docstring format
A
def drawsquare(t, sz): """Make turtle t and draw square of size sz"""
2
Q
Runtime-retrievable documentation
A
Docstring
3
Q
Function Call other name
A
Function Invocation
4
Q
Function Invocation other name
A
Function Call
5
Q
Functions that return are called
A
Fruitful
6
Q
Default return of functions
A
None
7
Q
“Same thing” as far as unit test parameters are concerned
A
Equivalence Class
8
Q
Local and global variables of same name
A
Shadowing
9
Q
Parameters vs Arguments
A
Arguments are actual parameters/things given
10
Q
How say __main__
A
Dunder main
11
Q
How to invoke main() selectively
A
if __name__ == “__main__”:
main()
12
Q
Rounding
A
round(1.001) == 1 ==> True
13
Q
Pytest format
A
def test_3_to_the_2(): assert 9 == math.exponent(3, 2)
14
Q
Functional decomposition
A
Breaking big problems into smaller ones
15
Q
Breaking big problems into smaller ones
A
Functional Decomposition