Textbook (Required)
Clicking on the link below will take you to the Runestone Interactive
E-book. This is a free book required for Compsci 101 at Duke. You'll
need to register for the book by specifying a username. For the
course name choose
DukeCompsci101 -- this will allow you to
track your progress and for us to track the class' progress.
How to get the book:
Weekly Readings
- 1. General Introduction (all)
- 2. Simple Python Data (all)
- 3. Debugging Interlude 1 (all)
- 4.1-4.3
- 4.1. Hello Little Turtles!
- 4.2. Our First Turtle Program
- 4.3. Instances - A Herd of Turtles
- 5. Python Modules (all)
- 6.1-6.4
- 6.1. Functions
- 6.2. Functions that Return Values
- 6.3. Unit Testing
- 6.4. Variables and Parameters are Local
- 4.4-4.6
- 4.4. The for Loop
- 4.5. Flow of Execution of the for Loop
- 4.6. Iteration Simplifies our Turtle Program
- 7.1-7.5
- 7.1. Boolean Values and Boolean Expressions
- 7.2. Logical operators
- 7.3. Precedence of Operators
- 7.4. Conditional Execution: Binary Selection
- 7.5. Omitting the else Clause: Unary Selection
- 9.1-9.7
- 9.1. Strings Revisited
- 9.2. A Collection Data Type
- 9.3. Operations on Strings
- 9.4. Index Operator: Working with the Characters of a String
- 9.5. String Methods
- 9.6. Length
- 9.7. The Slice Operator
- 4.7-4.11
- 4.7. The range Function
- 4.8. A Few More turtle Methods and Observations
- 4.9. Summary of Turtle Methods
- 4.10. Glossary
- 4.11. Exercises
- 6.5. The Accumulator Pattern
- 9.8-9.11, 9.14, 9.16
- 9.8. String Comparison
- 9.9. Strings are Immutable
- 9.10. Traversal and the for Loop: By Item
- 9.11. Traversal and the for Loop: By Index
- 9.14. The Accumulator Pattern with Strings
- 9.16. Looping and Counting
- 10.1-10.8, 10.14
- 10.1. Lists
- 10.2. List Values
- 10.3. List Length
- 10.4. Accessing Elements
- 10.6. Concatenation and Repetition
- 10.7. List Slices
- 10.8. Lists are Mutable
- 10.14. List Methods
- 8.1-8.3, 8.8
- 8.1. Iteration Revisited
- 8.2. The for loop revisited
- 8.3. The while Statement
- 8.8. Other uses of while
- 11.1-11.6, 11.8, 11.9
- 11.1. Working with Data Files
- 11.2. Finding a File on your Disk
- 11.3. Reading a File
- 11.4. Iterating over lines in a file
- 11.5. Alternative File Reading Methods
- 11.6. Writing Text Files
- 11.8. Glossary
- 11.9. Exercises
- All the sections in Sets at wikibooks, except "frozenset"
- 8.11 2-Dimensional Iteration: Image Processing
- 10.9-10.13, 10.15-10.25
- 10.9. List Deletion
- 10.10. Objects and References
- 10.11. Aliasing
- 10.12. Cloning Lists
- 10.13. Repetition and References
- 10.15. The Return of L-Systems
- 10.16. Append versus Concatenate
- 10.17. Lists and for loops
- 10.18. Using Lists as Parameters
- 10.19. Pure Functions
- 10.20. Which is Better?
- 10.21. Functions that Produce Lists
- 10.22. List Comprehensions
- 10.23. Nested Lists
- 10.24. Strings and Lists
- 10.25. list Type Conversion Function
- 10.26-10.28
- 10.26. Tuples and Mutability
- 10.27. Tuple Assignment
- 10.28. Tuples as Return Values
- 12.1-12.4, 12.6, 12.7
- 12.1. Dictionaries
- 12.2. Dictionary Operations
- 12.3. Dictionary Methods
- 12.4. Aliasing and Copying
- 12.6. Glossary
- 12.7. Exercises
- The introduction and definition sections of wikipedia's page on prime numbers
- Reading the introduction of the CSV module documentation and about the following functions:
- csv.reader
- csv.writer
- csvwriter.writerow
- csvwriter.writerows
- Read Python.org's how to on sorting, focusing on the following parts:
- Introduction
- Sorting Basics
- First example in Key Functions (You do not need to understand the other examples)
- itemgetter in Operator Module Functions (You do not need to understand attrgetter and methodcaller)
- Ascending and Descending
- Sort Stability and Complex Sorts
Week 12: 4/9 - 4/13, No reading quiz
Week 13: 4/16 - 4/20, No reading quiz