Intro to
Programming
(with Python)

Fall 2019
course
site

I've mostly caught up with grading midterms & homework.

Next week's assignment is posted - including a proposal for a final project ... which will be coming up very fast.

Thu Nov 14 - practice

asides :

today:

I'm going to show and discuss several code examples. Please do use this as models of what your projects might look like ...

counting words

We discussed last time counting words. Check out counting moby dick , which shows file processing, the use of dictionaries for counting, and some tricky sorting.

playing cards

Your assignment this week is to practice with objects by setting up a card game, continuing last week's homework.

Here's an example to get you started : cards_v1.py , showing how objects can interact.

tic tac toe

And here's one more example of object oriented programming, a terminal (as opposed to graphical) tic tac toe program, including a random computer player.

Notice how the Person and Computer objects both have the same API (i.e. methods), so that that Game object can ask either one for a move without needing to know which is which - it just needs to know how to get a move from player X or player O.

https://cs.marlboro.college /cours /fall2019 /python /notes /practice1
last modified Thu November 21 2024 12:09 pm