Modules and Packages

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:55 PM on 9/23/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

modules

single files containing Python code, like functions and classes, that serve as self-contained units of code

2
New cards

maintainability

modules allow changes to be made to independent parts without affecting the whole application

3
New cards

reusability

can write the code once and use it many times throughout the application

4
New cards

collaboration

modules allow different teams to work on an application without interfering with each other’s work

5
New cards

readability

modules make it easier to see what’s going on

6
New cards

dir()

returns a sorted list of all attributes available in a module

7
New cards

__file__

returns physical name of module

8
New cards

__package__

returns the packages to which the module belongs

9
New cards

__doc__

returns the docstring at the top of the module if any

10
New cards

__dict__

returns the entire scope of the module

11
New cards

__name__

returns the name of the module

12
New cards

packages

collections of related modules organized in directories that contain the __init__.py file

13
New cards

if _name_ == “_main_”

used to determine whether the Python file is being run directly or being imported as a module into another script

14
New cards

library

a collection of related packages and modules providing specific functionality

15
New cards

*args

used to pass a variable number of non-keyworded (positional) arguments to a function

  • the * unpacks the arguments into a tuple


16
New cards

**kwargs

used to pass a variable number of keyword arguments to a function

  • the ** unpacks the arguments into a dictionary