Intro to
Programming
(with Python)

Fall 2016
course
navigation

Nov 17

ATM data structure & simulation example

Discuss my code in the atm folder.
Perhaps modify it according to one of the "TODO" items in its top docstring.

recursion examples & practice

Check out the examples in the recursion folder : searching a list, finding the max in a list, and a complete computer player engine for the subtraction game.
We'll look some of these over the next week or so.
The idea behind computer game search is this :

art

This site isn't python, but is a nice collection of images defined with recursion. Something along these lines could be accomplished with Zelle's graphic library as a possible final project.
Recursion Class Exercise :
Write a recursive function that finds the maximum value of a list. The idea is to think of a list recursively as (list) = (first_element, list) and so max(list) = max( first_element, max(list) ) What is the stopping condition ?
Two versions of this exercise are attached.
http://cs.marlboro.edu/ courses/ fall2016/python/ notes/ Nov_17
last modified Thursday November 17 2016 11:32 am EST

attachments [paper clip]

     name last modified size
   maxrecur.py Nov 17 2016 11:28 am 532B    maxrecur2.py Nov 17 2016 11:28 am 471B