Homework help requested (not what you think!)

Beth McNany beth.mcnany at gmail.com
Thu Jul 18 00:03:06 CEST 2013


On Tue, Jul 16, 2013 at 6:43 PM, John Ladasky <john_ladasky at sbcglobal.net>wrote:

> Hi folks,
>
> No, I'm not asking for YOU to help ME with a Python homework assignment!
>
> Previously, I mentioned that I was starting to teach my son Python.
>
> https://groups.google.com/d/msg/comp.lang.python/I7spp6iC3tw/8lxUXfrL-9gJ
>
> He just took a course at his high school called Web Technology and Design.
>  They had the students use tools like Dream Weaver, but they also
> hand-coded some HTML and JavaScript.  He has a little experience.  I am
> building on it.
>
> Well, a few other parents caught wind of what I was doing with my son, and
> they asked me whether I could tutor their kids, too.  I accepted the jobs
> (for pay, actually).
>
> The kids all claim to be interested.  They all want to write the next
> great 3D video game.  Thus, I'm a little surprised that the kids don't
> actually try to sit down and code without me prompting them.  I think that
> they're disappointed when I show them how much they have to understand just
> to write a program that plays Tic Tac Toe.
>
> Where programming is concerned, I'm an autodidact.  I started programming
> when I was twelve, with little more guidance than the Applesoft Basic
> manual and the occasional issue of Byte Magazine.  I hacked away.  Over the
> years, I have acquired a working knowledge of BASIC, 6502 assembly
> language, Pascal, C, and finally Python (my favorite).  If I knew how to
> impart a love of experimentation to my students, I would do that.
>
> One kid looks like he's ready to forge ahead.  In the mean time, one
> parent has recognized his son's lack of independence, and has asked me to
> assign programming homework.  I hope it doesn't kill the kid's enthusiasm,
> but I'm willing to try it.
>
> So, what I am seeking are suggestions for programming assignments that I
> can give to brand-new students of Python.  Please keep in mind that none of
> them are even up to the task of a simple algorithm like Bubble Sort -- at
> least, not yet.
>
> Many thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Thanks for this!  I'm trying to put together something very similar right
now for my younger brother, and this thread and associated links have been
very helpful.  He's taught himself enough Python to make a rudimentary text
adventure game already, so the interest is definitely there.  I'm hoping to
sneak in some general CS concepts as well, although I'm concerned some
things might be less obvious in Python.  Also, I learned to program in PHP
and Java before I learned Python (starting with a Django project), so I'm
not sure how to start there... probably going to borrow some ideas from the
intro level Java class I've been TA'ing.

In my experience, people learn best via projects, so I've been trying to
come up with some that are interesting, not too difficult, and focus on one
or two main concepts.  To be honest, I have no idea how realistic they are,
because it's been a while since I first learned how to program and that
wasn't even in Python.  Offering it up here for your perusal / feedback
(roughly in the order I'd do them):

- text adventure: practice with stdlib, control flow, I/O. Lots of
opportunities for embellishment here - create maps of rooms, load/save
games by serializing into files or even a database, create status bars in
the console, etc.

- blackjack:  a game with simple rules, you have to think about
representation for the cards, and you can easily simulate a computer
opponent.  extra credit: graphical front-end that displays images for the
cards.

- sudoku checker/generator/solver: practice with lists, loops, logic,
implementing algorithms.  extra credit: design a solver yourself without
looking up algorithms.

- mandelbrot set app: math and graphics! can use this as an opportunity to
introduce numpy/matplotlib, or DIY.  (could be a bit esoteric depending on
the student, though.)

- game of life: simple graphics and update rules, fun to watch, source of
the unofficial hacker emblem.

- (extra credit?) simple chat program: this doesn't really fit the theme,
but it's an introduction to networking / sockets, which could be useful.
(and the intro class had lots of fun sending messages back and forth in
class.)

At this point, I'm hoping he'll be comfortable enough to begin working on a
more complete game (most likely, using pygame, as he hasn't expressed much
interest in 3D).  Some ideas for classic/simple/well-defined games to try:
- blob game (what is this one actually called? where the player absorbs
smaller entities to grow but dies if he runs into a bigger entity)
- tank battle (again, not sure on the name. two players, moving around,
shooting at each other on a map with obstructions)
- maze (bonus points for a maze generation algorithm)
- snake
- frogger
- asteroids
- etc.

This doesn't include a lot of standard but less flashy stuff e.g. advanced
data structures, graphs, sorting algorithms, because the idea was to find
projects that would be tractable for someone just starting out and wanting
to make fun things... but once they're hooked, you can explain how they're
useful and start into those (at least, that's my theory).  But you could
still talk about things like classes, OO design, exception handling,
recursion, complexity (especially with the sudoku project), as related to
these projects.

(As a side note, I'm a bit amused by the discussions about teaching "kids"
specifically.  When I was 17 I was a freshman enrolled in a Data Structures
course, where I discovered that a course I took two years prior had already
covered about 90% of the material...)

-beth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130717/a2b96ebd/attachment.html>


More information about the Python-list mailing list