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!
- Part 1
- Read Ch 9 – ideally:
- 1st half before Friday
- 2nd half before Monday
Monday's Review¶
- Solutions in Canvas Files
- See provided test modules
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!
-
Click "Testing" (bottom icon) on the Activity Bar:
-
Click the "Configure Python Tests" button.
- Select pytest
- Select ". Root directory"
-
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:
-
Click "Explorer" (top icon) on the Activity Bar.
-
Add the following to your
.vscode/settings.json
file:"files.exclude": { "**/__pycache__": true, "**/.pytest_cache": true, "**/.coverage": true },