Python Fundamentals · Getting started
20 cards
The Python Language, System, and Ecosystem
-
Quick check
Someone says "Python" for the rules that give code its meaning, and again for the program that runs a script. Which split is correct?
AThe Package Index defines the rules; a module runs the script
The Package Index is a source of community components; it defines no syntax and runs nothing.
BThe standard library defines the rules; the language runs the script
The standard library is a set of distributed modules rather than the definition of the language, and a language does not execute anything by itself.
CThe language defines the code; the interpreter executes it, interactively or from a file
Right. The Language Reference gives the formal definition, and the interpreter executes commands interactively or runs scripts from files.
3 / 20
-
Quick check
Where do lists and dictionaries belong in this picture?
AThey are third-party components installed from the Package Index
Built-in types arrive with the language itself; nothing has to be installed before a list can be used.
BThey are built-in types the language makes available to Python code
Right. Numbers, text, lists and dictionaries are built-in types of the language system, available to Python code.
CThey are compile-and-link tools that must run before the interpreter starts
Python needs no separate compile-and-link stage, and a data type is not a build tool.
6 / 20
-
Quick check
A program has grown and two other programs now need the same behavior. What does moving it into a module achieve?
AThe code becomes reusable by other Python programs
Right. A module is a reusable unit that lets a program be split into code that other Python programs can use.
BThe code is rewritten in a different language for each program
A module is a unit of organization, not a different language.
CThe behavior stops being Python and becomes an interpreter option
Modules are ordinary Python code and do not change how the interpreter is started.
8 / 20
-
Keep your progress in the app
That’s 3 of 7 quick checks. In the app they stay answered, and every lesson remembers where you left off.
-
Quick check
What does calling the standard library "standard" actually claim?
AEvery optional component is packaged identically on every distribution and platform
The exact availability of optional components can vary by distribution and platform.
BIt contains only modules written in Python
It contains built-in modules written in C as well as modules written in Python.
CIt is distributed with Python and standardizes everyday solutions
Right. The standard library is distributed with Python and provides standardized solutions for many everyday programming problems.
11 / 20
-
Quick check
A program must read and write files without hand-writing a different system call for each operating system. Which layer should be checked first?
AThe standard library, whose modules can hide platform specifics behind platform-neutral APIs
Right. Standard-library facilities include files and operating-system services, and some modules deliberately hide platform-specific details behind platform-neutral APIs.
BThe Package Index, since file access is never distributed with Python
File input and output is part of what is distributed with Python, so a community package is not the first place to look.
CA separate interpreter written for each target platform
The interpreter already exists for those platforms; the open question is which distributed modules to use.
14 / 20
-
Quick check
A team adopts an application framework published by the community and not distributed with Python. How should that dependency be classified?
AAs part of the standard library, guaranteed on every installation
The standard library is what is distributed with Python; a community framework is obtained separately.
BAs a third-party package
Right. Community modules, programs, tools, packages and application frameworks are third-party components, and the Python Package Index collects them.
CAs a built-in type defined by the language itself
Built-in types come with the language, and installing a package does not create one.
17 / 20
-
Quick check
A programmer wants the formal definition of Python's syntax, and then documentation for the distributed file and testing modules. Which pair answers those two needs, in order?
AThe Package Index, then a community framework
The Package Index collects community components; neither entry defines the language nor documents the modules distributed with Python.
BThe interactive prompt, then a list of the packages installed in the environment
A prompt runs code and an install list shows dependencies; neither is the documentation being asked for.
CThe Language Reference, then the standard-library reference
Right. The Language Reference gives the formal definition of the language, and the library reference describes the modules distributed with Python.
20 / 20
-
7 quick checks · then the test
In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.
The whole course, on your phone
Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.