CSCI201: Computer Programming I

Updated 2021-12-14

#### Software used in this class

·          Required: Anaconda. Choose Python 3.8, 64-bit graphical installer for your computer (there is a Windows version and a Mac version).

·          Optional: An online Python interpreter, another one

# Final Test. Tuesday, 12/14

·         Program shell.

·         Data file: phone.txt

# Day 30. Thursday, 12/09. Review for final test

·         Review topics

·         Practice test, primes file, happy file.

·         Practice test solution

·         Quick references:

·         Complete online evaluations

Earlier classes are below…

# Day 29. Tuesday, 12/07: Recursion

·

·

·         Chapter 16: Recursion. Notes.

·         Examples of recursion (videos): Flood-fill, fractal

·         Examples of recursion (Python code): Sierpinski triangles, Towers of Hanoi

#### Homework

·         Program #29: Recursion.

# Day 28. Thursday, 12/02: Objects

·         Objects, part 2

#### Homework

·         Program #28: Write an Account class for a bank savings account and the code to test it.

# Day 27. Tuesday, 11/30: Objects

·          PredictionClean code

·         Objects. Notes.

# Day 26. Tuesday, 11/23

·         Pattern matching: regular expressions. Notes. Regular Expression Quick Guide.

·         Regular expression exercises. Answers: #1: p.t , #2: ap.{0,1}t, #3: af.{0,1}g.{0,1}k, #4:

·         References: Online chapter. Watch these videos: Video 1. Video 2. Video 3.

#### Homework

·         Program #26: Using regular expressions to find patterns in an email data file. Instructions. mbox.txt. mbox-short.txt.

# Day 25. Thursday, 11/18

·         More Python online resources: Exercises, Coursera online book, Coursera online videos. Py4E video 1. Py4E video 2. Py4E video 3.

·         Sample problems. Translate English to pirate.

·

# Day 24. Tuesday, 11/16: Dictionaries

·         Dictionaries. Notes. Video.

·         Sample problems. Alice.

#### Homework:

·         Program #24: World Series winners. Data file.

# Thursday, 11/11: Test

·         Test. Program shell.

#### Homework:

·         Program #22: The Linux wc utility. Sample files: GettysburgShort.txt, Gettysburg.txt.

·         Read chapter 12 (Dictionaries) for next Tuesday.

# Day 22. Tuesday, 11/09: Functions

·         Test #2 will be Thursday

·         Functions, parameters, scope. Notes.

#### Homework due 11/16:

·         Practice test. Code solution. Video solutions: Problem 1. Problem 2. Problem 3. Problem 4. Problem 5.

·         Program #22: The Linux wc utility. Sample files: GettysburgShort.txt, Gettysburg.txt.

·         Read chapter 12 (Dictionaries) for next Tuesday.

# Day 21. Thu 11/04. Files

·         Files. Notes.

·         Video 1. Overview & quarterbacks problem. QB stats file

·         Sample files problem (stocks): Video 2. Stocks description. Stocks file.

#### Homework:

·         Program 21A. World Series winners, version 2. Data file.

·         Program 21B: Computing homework averages. Data file.

# Day 20. Tue 11/02. More lists

·         Intro to lists, continued. Notes.

·         Quick guides: Arithmetic, Built-in functions, Conditionals, Lists, Strings, Turtle graphics.

#### Homework:

·         Program 20A: List algorithms

·         Program 20B: World Series winners. Data file. Function to read the World Series winners.

# Day 19. Thu 10/28. Lists, Functions

·         Intro to lists. Notes.

#### Homework:

·         Hangman. Words file. Copy the words file to the same folder as your .py file. get_word function.

# Day 18. Tue 10/26. Image manipulation, part 3

·         Steganography: Can you find the hidden picture here? here?.

·         How to hide a picture in a picture

·         How to hide a message in a picture

·         More image manipulation: notes. ivy.png, stop.png, curb.png, monkey.png, moon.png

#### Homework:

·         Program #18: Write the flip program described in the Notes link above (left to right, not top to bottom).

# Day 17. Thu 10/21. Image manipulation, part 2

·         More image algorithms. Notes.

·         Hidden pics: pic1, pic2.

#### Homework

·         Program #17. Add a black border to a pic. Here's a pic, but you may use one of your own. Put it in the same folder as your program.

# Day 16. Tue 10/19. Image manipulation, part 1

·         Image manipulation and nested loops. Notes. Images folder.

#### Homework

·         Program #16: 5-10-20 problem. Data file.

# Day 15. Tue 10/12. Nested Loops

·         More loops: nested loops. Notes.

#### Homework:

·         Program #15: Nested loops: Arrowheads

# Day 14. Thu 10/07. Nested Loops

·         News: Programming language popularity

·         Common integer algorithms.

·         More strings. Exercises.

#### Homework:

·         Program #14: Loops & functions: income tax.

# Day 13. Tue 10/05. More strings

·         More strings. Exercises.

#### Homework:

·         Program #13: Strings: Short Date.

# Day 12. Thu 9/30. More Strings

·         Quick guide: Strings.

·         More strings. Exercises.

·         Discuss Caesar Cipher program.

#### Homework:

·         12A: Strings & functions: Password validator

·         12B: Strings & functions: Caesar cipher.

·         Read Chapters 7 (Files) & 8 (Lists).

# Day 11. Tue 9/28. Strings

·         Indefinite (while) loops. Notes.

·         Strings: Notes.

·         1400 words

#### Homework

·         11: Strings & functions: email

# Day 10. Thu 9/23. Test#1

#### Homework due Tuesday:

·         Program #9: Functions

# Day 9. Tue 9/21. More Functions

·         First test is Thursday (9/23). Practice Test. Video solution.

·         Writing more functions. Notes.

·         Functions to write.

#### Homework due Tuesday, 9/28:

·         Program #9: Functions

# Day 8. Thu 9/16. Functions

·         We are skipping chapter 5 (Python modules) for the time being.

·         Writing functions. Notes.

·         Applying functions to turtle graphics

#### Homework:

·         Program #8: Functions

# Day 7. Tue 9/14. Turtle graphics, part 3

·         A Python milestone

·         How to succeed in a programming class

·         Some figures to draw today.

·         Colors in rainbow order (kind of)

·         Cycling through colors using the % operator (colored spiral)

#### Homework:

·         Program #7: Snowflakes.

# Day 6. Thu 9/09. Turtle graphics, part 2

·         More loops, more turtle graphics. Draw these patterns.

·         Web site for Python turtle graphics (if you have problems on your computer)

#### Homework:

·         Program #6: Spirals

# Day 5. Tue 9/07. Chapter 4: Turtle graphics, Repetition (loops)

·         Programming language popularity

·         Turtle graphics. Notes. Examples.

#### Homework:

·         Program #5: Stars

# Day 4. Thu 9/02. Chapter 7: More making decisions

·         More notes.

#### Homework:

·         Program #4A: Car rental.

·         Read chapter 4: Turtle graphics and the for loop.

# Day 3. Tue 8/31. Chapter 7: Making decisions

·         Selection: Notes.

#### Homework:

·         Program #3B: sales quota.

·         Program #3C: covid.

# Day 2. Thu 8/26. Chapter 2: Variables

·         Beginning Python continued: notes (same file as yesterday)

#### Homework due next class:

·         Program #1A: payroll. We will do this in class.

·         Program #1B: store discount.

·         Program #2B: shipping.

·         Read chapter 7 of our textbook (Selection and Conditionals).

# Day 1. Tue, 8/24. Data, input, output

·         How to become a superstar

·         Beginning Python: notes

#### Homework:

·         Read, print, and sign the Attendance, Test, and Homework Policies.

·         Read chapter 1 and chapter 2 of our textbook. Be prepared for a quiz.

# Day 30. Thursday, 12/09: Exceptions

·         Exceptions. Notes. List of Exceptions.

·