Calendar - Subject to change!
References
- Python.org's Python Tutorial
- python.org
- How to Think Like a Computer Scientist <--- this is the main textbook!
- How to Think Like a Computer Scientist @ Open Book Project (new version currently being written - not all chapters are there!)
- How to Think Like a Computer Scientist @ Green Tree Press
- Dive into Python book
- List of Python Modules (take a peek at the math module)
- keywords vs. identifiers
- Software:
- python/IDLE for windows
- python/IDLE for Mac python/IDLE for Macs. Click on "an installer for the latest version, but then pick packages for version 2.4. Don't worry about all the packages listed.
- CoC Tutoring
Week 1: January 7-11
- Course Syllabus
- Great article on O'Reilly's website
- Excellent Usenix article
- Read chapter 1 - How to Think Like a Computer Scientist (thinkCSpy)
- Playing around in the interpretive "shell"
- Script to convert Fahrenheit to Celsius
- Script to calculate hypotenuse
- Better script to calculate hypotenuse (has user input)
- Notes about print formatting
- Script to calculate area of circle (with user input)
- Work on Lab 1 (posted under "labs". See link on navigation bar above.) Contact TAs or Monica immediately with any issues.
- Read chapter 2 (How to think like a computer scientist)
- List of Python Modules (take a peek at the math module)
- keywords vs. identifiers
- Notes about variables, operators, etc
Week 2: January 14-18
- more notes: printing, commenting, operator precedence, quoting, etc
- day 4 python shell
- a script for converting to radians
- function radian written two ways
- ...
- See section 11.2 (although this about writing to files, it still has good examples of the string formatting.) for some more print formatting examples
- script to print an E e.py
- Chapter 3 (thinkCSpy)
- celsius_module.py - celsius converter written as a function
- Chapter 4 (thinkCSpy)
- tickets.py
- ticketsBetter.py
- week2-day3.txt - to and from binary (base 2 numbers)
Week 3: January 21-25
- Monday Holiday: Martin Luther King Day!
- operators.txt
- Read chapters 4 & 5 (How to think like a computer scientist)
- factorial2008.py using mathematical recursion! and printing stars recursively
Week 4: January 28-February 1
- A recursive game of High Low Exam 1 practice
- Exam 1 topics
- Exam 1 Friday!
Week 5: February 4-8
- craps.py using random and recursion!
- How to make a menu driven list of choices for the user recursively
- notes-ch5.txt (some reasons for writing functions)
- Using try/except to prevent problems
Week 6: February 11-15
- While loop - read chapter 6
- while2008.py (cookie intro)
- while.txt
- while.py - using a while loop to repeat (triangle, etc)
- factorialWhile.py
- How can we decide if a word is a palindrome? (Um, first, what is a palindrome?) (two palindrome algorithms and also a reverse function - working with Strings)
- How can we reverse some text?
- Easiest way
- Recursive way
- With a while loop? 1) using the indices or 2) slicing
- whilePrompting.py program that loops on a menu
- Read chapter 7 - Intro to Strings
- notes-ch7.txt
- String class
- reverseIt.py - String indexing, slicing, reversing
- Strings code notes
- ...
Week 7: February 18-22
- Incremental development and planning what you will code: designing an algorithm
- Our rough scrambled word algorithm and then the resultant scrambled word game.
- Chapter 9 - sequences, range, for loops
- for loop
- arrays2.py - average a list
- Monte Carlo Pi Approx. with for loop
- handy chart of some string (or any *sequence*) operations
- handy chart of sequence/array operations (will not work on strings!)
- range function to generate a sequence
- the for loop is very handy to iterate through a sequence
(list) of things.
- rarely it will be through a literal sequence of things like ["apple", "orange", "banana"]
- often it could be through a list of numbers generated by the range function
Week 8: February 25-29
- Exam 2 in class Friday!!
- In class quiz over for loops and range and answers
- averaging numbers in a sequence
- Exam 2 covers chapters 1-8 of the old version on the online book and chapters 1-9 (skipping 8) of the new version of the online book.
- old exam2
- another old exam2
- Some topics (this list is NOT comprehensive):
- recursion
- very simple try except code
- while loops - like looping on a menu
- range
- for loops - looping through a sequence created by range, or through a sequence of data.
- simple sequence processing: finding the average of the numbers, finding the smallest number, counting the numbers, summing the numbers
- String manipulation (see week 6) and methods in String class
- know how to reverse a word, how to test for a palindrome, how to write your own len function, etc
Week 9: March 3-7
- converting a list of Fahrenheit temps to a list of Celsius temps
- index of minimum
- more index of minimum
- plain minimum
- find, findAll, binary search, and help making a test array
- binary search
- binary search runs
- for loop could even go through a sequence which has a list of your files and folders! (os module and listdir in action!)
- listdir function from os module
- join, isfile, isdir functions from os.path
- listdir.py
- lookupTable.py
Week 10: March 10-14
- What if someone does type a bad path? Check try/except
- Writing to a file
- readFile.py
- words.txt
Week 11: March 17-21
- Holiday: Spring Break
Week 12: March 24-28
- Generating HTML and writing to a file
- readData2D.py - didn't talk about this one in class
- readTimeFromURL.py
- yahooTemperature.py
- Searching and sorting
- working with 2-d arrays - did not talk about this one in class.
Week 13: March 31-April 4
- Exam 3 in class Friday!!
- selection sort with better abstraction
- bubble sort
- quick sort
- Exam 3 practice problems - UPDATED for Spring 2008! (and yes, some of the numbers are skipped.)
- Exam 3 practice solutions (some of them)
- Exam 3 Friday
Week 14: April 7 - April 11
- merge sort
- Generalizing functions (passing functions as parameters) and python's built-in map/filter/reduce functions
- map,reduce,filter documentation
- more map,reduce,filter tutorial
- generalizing functions
- filter and map
- reduce
- PRACTICE with map, reduce, and filter
- PRACTICE solutions
- List comprehensions
- List comprehensions code
- Histograms and frequencies! Chap 9: Tuples
- tuples.py
- tuples interactive window
- Chap 10: Dictionaries (also known as hashtables.)
- Dive into Python online book - dictionaries
Week 15: April 14-April 18
- Ch 11.5 exceptions
- Python tutorial 8.3: Handling Exceptions
- Python tutorial 8.6: Finally clause
- Exception handling: exceptions.py
- exceptionAverage.py
Week 16: April 21-25
- Object oriented programming (but chap 14 is where it gets good)
- Dog.py
- OOCard.py
- whoGoes.py
- Dice.py
Week 17: April 28-May 2
- exam 1
- exam 2
- exam 3
- Review problems from Wednesday
- Review problems from Friday
- Final Exam Wednesday 2:50