This site applies only to CMPT 120 D1 (Burnaby) in Summer 2011. See the other instructors' pages for other sections.
From the Guide
These are examples that are directly related to the material in the course guide. You might also want to see the links page.
- The metres to feet and inches example:
- Simple guessing game
- Counting with a
for
loop - Calculating factorials
- A
while
loop - The guessing game example:
- Repeated letters
- Reading integers with a function
- Variable scope example
- Printing today's date
- Using
datetime
objects - Catching an exception
- Asking until input is correct
- Linear search
- Repeated letters with sorting
- Binary search
- Selection sort
- Recursive binary search
- Writing to a file 1
- Writing to a file 2
- Reading a file
- Reading times from a file, sample times input file
- Word count example:
From Lectures
These are examples from lecture in 1114.