Introduction to Computer Programming - CSCI-UA.0002-001 - Fall 2014

Jump to Class: 09/03, 09/08, 09/10, 09/15, 09/17, 09/22, 09/24, 09/29, 10/01, 10/06, 10/08 (midterm #1), 10/15, 10/20, 10/22, 10/27, 10/29, 11/03 11/05, 11/10, 11/12, 11/17, 11/19 (midterm #2), 11/24, 11/26, 12/01, 12/03, 12/08, 12/10

Schedule & Notes

# Date Topics Materials

1

09/03

  • Introductions
  • About Programming

Slides

Handouts

Reading a Program

Readings

Vocabulary

See the glossary in How to Think Like a Computer Scientist for chapter 1.

Homework #0

Nothing to submit… just some stuff to try at home:

  • read Starting Out with Python - Chapter 1
  • install python 3 on your computer
  • write "Hello world" on your own, but print out your name instead of "Hello world"
  • try purposely omitting a quotation mark…
  • what happens?

2

09/08

  • Values, Types, Operations, Variables
  • Input / Output

Slides

Readings

Vocabulary

(optional) See the glossary in How to Think Like a Computer Scientist, Chapter 2.

Homework #1

  • Due Monday, September 15th, before 11PM
  • Submit via NYU Classes
  1. questions.py - 9 points
  2. mad_libs_lyrics.py - 2 points
  3. exercises.py - 3 points
  4. tree.py - 3 points
  5. temperature.py - 4 points
  6. miles.py - 4 points

Example output for tree.py:

       /\
      /  \
      /  \
     /____\
       ||

   /\
   ""
  /""\ 
  """"
 /""""\
 """""" 
   ||

3

09/10

  • Basic Functions

Slides

Handouts

Types, Variables, Operators, Input and Comments

Readings

4

09/15

  • If Statements

Slides

Readings

Vocabulary

See the glossary for chapter 2 and chapter 5.

Homework #2

  • Due September 22nd (any submission before 11PM is on-time)
  • Submit all files via NYU Classes
  • Contact me if you're having trouble submitting your homework
  • Here's the policy on late homework
  1. questions_ch_5.py
  2. automobile_costs.py
  3. candy_bars.py
  4. days.py
  5. cats.py
  6. numbers.py (This one may be a little tough: I'll grade it generously)

5

09/17

  • Boolean Logic

Slides

Handouts

User Input, Type Conversion, Functions, If Statements

Readings

Vocabulary

See the glossary in How to Think Like a Computer Scientist, Chapter 5.

6

09/22

  • If Statements Revisited
  • Built-In Modules

Slides

Readings

Starting Out with Python

  • Chapter 3 (Decision Structures and Boolean Logic)
  • Chapter 5 on random module (pages 195 to 202)
  • Chapter 5 on math module (pages 217 to 219)

How to Think Like a Computer Scientist

Vocabulary

See the glossary in How to Think Like a Computer Scientist, Chapter 5.

Homework #3

  • Due September 29th (any submission before 11PM is on-time)
  • Submit all files via NYU Classes
  • Contact me if you're having trouble submitting your homework
  • Here's the policy on late homework
  1. questions_ch_3.py
  2. colors.py
  3. tip.py
  4. adventure.py
  5. distance.py
  6. worksheet.py

7

09/24

  • Built-In Modules (Continued)
  • While Loops

Slides

Readings

Starting Out with Python

  • Chapter 5 on random module (pages 195 to 202)
  • Chapter 5 on math module (pages 217 to 219)
  • Chapter 5 on creating modules, but ignore that the functions in the module are returning values (pages 221 to 223)
  • Chapter 4 (up to page 130)

How to Think Like a Computer Scientist

Vocabulary

See the glossary in How to Think Like a Computer Scientist, Chapter 12. See the glossary in How to Think Like a Computer Scientist, Chapter 7.

8

09/29

  • While Loops (Continued)
  • For Loops

Slides

Readings

Starting Out with Python

  • Chapter 4 on while loops
  • Chapter 4 on for loops

How to Think Like a Computer Scientist

Vocabulary

See the glossary in How to Think Like a Computer Scientist, Chapter 7.

Homework #4

  • Due October 6th, at 11PM
  • Submit all files via NYU Classes
  • Contact me if you're having trouble submitting your homework
  1. questions_ch_4.py
  2. count.py
  3. word_length
  4. exclaim.py
  5. guess.py
  6. many_words.py
  7. dice.py

9

10/01

  • For Loops (Continued)
  • For vs While

Slides

Readings

Vocabulary

See the glossary

10

10/06

  • Midterm #1 Review

Slides

Handouts

Homework Solutions

11

10/08

  • Midterm #1

10/13

NO CLASS - Fall Recess

12

10/15

  • More About Loops
  • Turtle Intro

Slides

Readings

Starting Out with Python

  • Chapter 4 - Nested Loops

How to Think Like a Computer Scientist

Vocabulary

See the in Chapter 7 of How to Think Like a Computer Scientist

Homework #5

  1. snake_eyes.py
  2. slashes.py
  3. stars.py
  4. squares.py
  5. lots_of_stars.py
  6. spirals.py

13

10/20

  • Turtle

Slides

Readings

Starting Out with Python

See readings for How to Think Like a Computer Scientist

How to Think Like a Computer Scientist

Vocabulary

See the glossary in Chapter 3 of How to Think Like a Computer Scientist

14

10/22

  • Returning Values from Functions

Slides

Handouts

Starting Out with Python

  • Chapter 5 on Value Returning Functions

How to Think Like a Computer Scientist

Homework #6

  1. questions_ch_5.py
  2. practice.py
  3. prime.py
  4. clicky.py
  5. pluralize.py

15

10/27

  • More About Functions

Slides

Handouts

Functions

Readings

Starting Out with Python

  • Chapter 5 on Value Returning Functions

How to Think Like a Computer Scientist

16

10/29

  • Testing and Documentation
  • Strings

Slides

Readings Starting Out with Python

  • Chapter 8 on More About Strings
  • Chapter 12 on Recursion

How to Think Like a Computer Scientist

Homework #7

  1. questions_ch_8_ch_12.py
  2. day_add.py
  3. count_spaces.py
  4. nerd_talk.py
  5. recursive_power.py
  6. prime_extra_credit.py

17

11/03

  • Strings as Objects

Slides

Readings

Starting Out with Python

  • Chapter 8 on More About Strings

How to Think Like a Computer Scientist

Selected Homework Solutions

For homework #5 (nested loops):

18

11/05

  • Strings Wrap-Up
  • Lists

Slides

Readings

Starting Out with Python

  • Chapter 8 on More About Strings
  • Chapter 7 on Lists

How to Think Like a Computer Scientist

Homework #8

  • Due Nov 12th at 11PM
  • Submit all files via NYU Classes
  • Description of each assignment is in a comment in each file
  1. questions_ch_8_ch_7.py
  2. get_first_word
  3. pig_latin.py
  4. translate_passage.py
  5. is_palindrome.py
  6. larger_than_five.py

19

11/10

  • Lists (Continued)

Slides

Readings

Starting Out with Python

  • Chapter 7 on Lists

How to Think Like a Computer Scientist

Selected Homework Solutions

hw6

20

11/12

  • Lists (Continued)

Slides

Readings

Starting Out with Python

  • Chapter 7 on Lists

How to Think Like a Computer Scientist

Homework #9

  • Due Nov 16th (any submission before 11PM is on-time)
  • Grace period until Nov 17th, 9AM
  • Submit all files via NYU Classes
  • Description of each assignment is in a comment in each file

These are in order of increasing difficulty.

  1. questions_ch_7.py
  2. practice.py
  3. unique.py
  4. fortune_improved
  5. balance.py

Selected Homework Solutions

hw7

21

11/17

  • Midterm #2 Review

Slides

Sample Exam Questions

Readings

Slides from class #12 through class #20

Starting Out with Python

  • Chapter 4 - Loops
    • Section 4.7 on Nested Loops
  • Chapter 5 - Functions
    • Returning Values
    • Scope - Global / Local Variables
  • Chapter 7 - Lists
  • Chapter 8 - More About Strings
  • Chapter 12 - Recursion

How to Think Like a Computer Scientist

Homework Solutions

hw5

hw6

hw7

hw8

hw9

22

11/19

  • Midterm #2

23

11/24

  • Lists and Mutability
  • File I/O
  • Exceptions

Slides

We didn't get a chance to look at:

Main Topics

Readings

Starting Out with Python

  • Chapter 6 on Files and Exceptions

How to Think Like a Computer Scientist

Homework #10, Homework Extra Credit

  • Due Wednesday, 12/03, before 11PM
  • Description of each assignment is in a comment in each file
  1. questions_ch_6.py
  2. practice_mutability_exceptions.py
  3. grocery_list.py
  4. nba.py
  5. bubble_sort.py
  6. (Extra Credit) battleship.py

24

11/26

  • Files (Continued)
  • Exceptions (Continued)
  • Tuples

Slides

Topics

Readings

Starting Out with Python

  • Chapter 6 on Files and Exceptions
  • Chapter 7 on Lists and Tuples

How to Think Like a Computer Scientist

25

12/01

  • File I/O
  • Exceptions
  • Tuples <!–
  • Dictionaries –>

Slides

Readings

Midterm 2 Solutions

Midterm #2 Solutions

26

12/03

  • Tuples Review
  • Dictionaries

Slides

Readings

Homework #11

  • Due Dec 9th before 11PM
  • Submit all files via NYU Classes
  • Description of each assignment is in a comment in each file
  1. exercises.py
  2. swappy.py
  3. together.py
  4. Extra Credit - main_jane.py

27

12/08

  • Open Topic

Slides

Final Exam Practice Questions

28

12/10

  • Final Exam Review

Review Slides

Recent Topics

Previous Review Slides

Midterm #2

Midterm #1

Selected Homework Solutions

Homework 10

Homework 11

Final Exam

  • date: Wednesday, December 17, 2014
  • time: 12:00PM - 1:50PM
  • room: WWH 101

Final Exam Practice

Midterm 1 and 2 Solutions and Practice Questions

Readings

How to Think Like a Computer Scientist

Starting Out with Python

  • Chapter 1: Introduction to Computers and Programming
  • Chapter 2: Input, Processing, and Output
  • Chapter 3: Decision Structures and Boolean Logic
  • Chapter 4: Repetition Structures
  • Chapter 5: Functions and Modules (ignore default parameters, namespaces and keyword arguments)
  • Chapter 6: Files and Exceptions (ignore raise)
  • Chapter 7: Lists and Tuples
  • Chapter 8: More About Strings
  • Chapter 9: Dictionaries and Sets (only dictionaries and exceptions)
  • Chapter 12: Recursion

  • Final Exam
  • date: Wednesday, December 17, 2014
  • time: 12:00PM - 1:50PM
  • room: WWH 101

CSCI-UA.0002-001 - Introduction to Computer Programming - Fall 2014