Python Libraries Flashcards

1
Q

what are libraries used for

A

sharing and re-using code among different programs

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

what is the difference between functions and libraries

A

libraries re-use code among different programs and functions within the same program

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

what are the two types of Python libraries

A

module and package

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

what is a module

A

a file that contains definitions and statements

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

what is a package

A

collection of modules in a hierarchy

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

does module need to be a program

A

no

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

what a module can contain

A

for example: classes, variables, functions

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

what is an entry point

A

if __name__ == “__main__”:

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

is module entry point executed upon import

A

no

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

in Linux where can you change PYTHONPATH

A

.bashrc

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

what is needed in each package folder

A

__init__.py file

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