Modules and imports
Splitting a program into files that others can import, so a function is written once and used everywhere - plus the standard library that comes with Python and the packages others share.
Depth 1 · Foundation
You can put functions in a module and import them three ways, guard test code with if __name__ == "__main__", use math, random (with a seed), datetime and collections.Counter, and know what pip and PyPI are for.
Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.
Sign in with GoogleDepths of understanding
- 1
Foundation
You can put functions in a module and import them three ways, guard test code with if __name__ == "__main__", use math, random (with a seed), datetime and collections.Counter, and know what pip and PyPI are for.
Your path here
What's still between you and Modules and imports, depth 1, in the order you can learn it.
- 1ProgramDepth 1 · Foundation · Program Basics
- 2ExpressionDepth 1 · Foundation · Program Basics
- 3Variables in codeDepth 1 · Foundation · Program Basics
- 4Program stateDepth 1 · Foundation · Program Basics
- 5Input and outputDepth 1 · Foundation · Program Basics
- 6Functions in codeDepth 1 · Foundation · Functions
- 7Modules and importsDepth 1 · Foundation · Organizing Programs
Where it fits
Builds on
This concept
Opens up