Prepstellar

Python Fundamentals · Practice set 3 of 8

A Python Development Workflow: 10 practice questions

10 questions · Untimed · Free

10 free Python Fundamentals practice questions on A Python Development Workflow, with an explanation for every answer. Untimed. The full mock exam and the timed version are in the app.

Set 3 · A Python Development Workflow · 10 questions Read the lesson
  1. Question 1 of 10

    Which mode is best for trying a small Python expression immediately?

    1. AA module copied repeatedly into several unrelated files
    2. BInteractive interpreter mode
    3. CA saved script
    4. DA required compilation and linking phase before any test
    Show the answer

    Interactive mode evaluates commands as they are entered and is suited to quick experiments.

    Next → 1 / 10
  2. Question 2 of 10

    After a one-off terminal experiment works, what makes the same code repeatable?

    1. AKeep only the terminal history
    2. BAn operating-system installer instead of Python code
    3. CEvery third-party package available from the community
    4. DSave the code in a script for later runs
    Show the answer

    Saved script code can be invoked again, while an interactive experiment is aimed at immediate evaluation.

    Next → 2 / 10
  3. Question 3 of 10

    What is the main workflow benefit of splitting code into modules?

    1. AThe code can be reused by other Python programs
    2. BBlock interpreter execution
    3. CThe module must be duplicated before another program can use it
    4. DThe code becomes a different language on each operating system
    Show the answer

    Modules separate responsibilities into units that other Python programs can reuse.

    Next → 3 / 10
  4. Question 4 of 10

    Which sequence best separates exploration from repeatable execution?

    1. AExperiment interactively, then save working code in a script
    2. BDuplicate each experiment across files, then avoid executing the result
    3. CKeep the experiment unsaved
    4. DCompile every expression, then replace the interpreter with a batch file
    Show the answer

    Interactive evaluation supports rapid feedback, while a saved script preserves code for repeated runs.

    Next → 4 / 10
  5. Question 5 of 10

    What does placing `-i` before a script do?

    1. AImports every community package before starting the interpreter
    2. BRuns the script and then enters interactive mode
    3. CSkip the script and open a prompt
    4. DLinks the script as a native application and exits immediately
    Show the answer

    The option combines repeatable script setup with an interactive session that follows it.

    Next → 5 / 10
  6. Keep the ones you got wrong

    In the app, every question you miss comes back exactly when you’re about to forget it.

  7. Question 6 of 10

    Which command form executes a module's source as a script?

    1. A`python -c` followed by an empty command
    2. BA file name passed to a non-Python text editor
    3. C`python -i`
    4. D`python -m module`
    Show the answer

    The `-m` form locates the named module and executes its source as a script.

    Next → 6 / 10
  8. Question 7 of 10

    When should the standard library enter the workflow?

    1. AWhen an existing distributed module fits the program's need
    2. BAfter rewriting every available file and system facility from scratch
    3. CBefore the problem and required capability have been identified
    4. DOnly when Python code must be converted into shell syntax
    Show the answer

    Standard modules provide foundations for common work and should be considered when their documented capability matches the task.

    Next → 7 / 10
  9. Question 8 of 10

    A developer must initialize objects from a repeatable file and then inspect them through immediate commands. Which invocation supports both requirements?

    1. ARun the script with `-i` before its file name
    2. BRun an unrelated module with `-m` and discard the setup script
    3. CUse terminal input while refusing to execute the saved initialization code
    4. DEdit the file without running it
    Show the answer

    Placing `-i` before the script executes its repeatable setup and leaves the interpreter in interactive mode afterward.

    Next → 8 / 10
  10. Question 9 of 10

    A utility has grown beyond one file, and two other Python programs need the same parsing behavior without copied code. What is the appropriate next step?

    1. APaste the parsing code into both programs and maintain three copies
    2. BLeave it in an unsaved session
    3. CMove the parsing behavior into a reusable module
    4. DReplace the parsing behavior with an operating-system launcher name
    Show the answer

    Modules provide the documented unit for splitting programs and sharing reusable code across Python programs.

    Next → 9 / 10
  11. Question 10 of 10

    A team has identified a file-processing task, validated one operation interactively, and now needs repeatable execution plus reuse in another program. Which sequence fits?

    1. APackage the terminal history as an operating system before selecting any library
    2. BDiscard the experiment, avoid saved code, and repeat all commands manually
    3. CConvert the operation to a platform-specific shell command and duplicate it
    4. DSave a script, extract reusable behavior into a module, and use suitable library facilities
    Show the answer

    The workflow moves from feedback in interactive mode to a saved script, modular reuse, and selection of existing library support.

    Next → 10 / 10
  12. You’ve finished this set

    That’s 10 questions on A Python Development Workflow. In the app 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.