Skip to content

Oct 23: Prac4, Strings and Lists

Learning Objectives

After today's class, you should be able to:

  • Implement short Python functions, on paper, with correct formatting.
  • Describe methods for manipulating strings and analyzing English text.

Announcements

  • PA 1 FlexDoko (modules + testing)
    • Part 1 utilities.py due Friday 10/25 (30 pts)
    • Part 2 game_logic.py due Friday 11/01 (60 pts)   extended
    • However, PA2 will begin Wed Oct 30, so don't procrastinate!
  • Read Ch 9 – ideally:
    • 1st half before Friday
    • 2nd half before Monday

Monday's Review

Practice Quiz 4

News flash: Quiz 4 will be 100% on paper next week.

  • 1st sheet: "written potion"
  • 2nd sheet: "coding potion" (write code on paper)
  • Turn off monitor during quiz

More VS Code

You can run pytest automatically in VS Code!

  1. Click "Testing" (bottom icon) on the Activity Bar:

    VS Code Screenshot

  2. Click the "Configure Python Tests" button.

    • Select pytest
    • Select ". Root directory"
  3. Now you can click the "" buttons to run pytest.

Over time, extra folders like __pycache__ and .pytest_cache will be created automatically. You can hide these folders in VS Code:

  1. Click "Explorer" (top icon) on the Activity Bar.

  2. Add the following to your .vscode/settings.json file:

        "files.exclude": {
            "**/__pycache__": true,
            "**/.pytest_cache": true,
            "**/.coverage": true
        },