Saturday, August 11, 2018

Teaching Intro Programming in Python

You might be about to teach an intro programming course in Python, or you might be interested in teaching such a course.  In this post, I will post my daily schedule and include as many materials as I can.  Everything I mention is completely free.

Some basics:
  • I "flipped" this a bit.  Most of the class sections are me showing off functions I wrote and asking the students to write them themselves.  Students have to do some homework before class to initially learn the topics.
  • My class meets for 50 minutes at a time.  You may have to adjust the topics if yours meets longer.
  • I am using Python 3.x.
  • I'm using Allen Downey's Think Python text.  There is a paper version, or students can use the HTML or PDF versions that are freely available from the homepage.  I do skip some chapters so that I make sure to cover inheritance.  Below, when I'm talking about sections, I'm talking about the sections from this text.
  • We have labs that meet for two hours each week.  Projects are due at the beginning of each lab.  I don't discuss the lab topics here.
  • The course homepage is: https://turing.plymouth.edu/~kgb1013/?course=2370  Depending on the time of the semester, different amounts of the course will be visible.  The homeworks include the reading and tiny exercises that will be visible once they've been assigned.
  • I posted previously about the lecture notes.  I give the examples of the functions I ask them to write in the notes.
  • If you do wind up using this schedule or the sample problems from my notes, please let me know!  Please let me know if you have any suggestions for improvement!
Here's what I do:

Day 0: Course Intro (syllabus)

Day 1: Chapter 1
  • Pre-homework: Read all of Chapter 1.
  • In class: Go over material in notes.
Day 2: Chapter 2
  • Pre-Homework: Chapter 2 
  • In class: Go over material in notes.
Day 3: Functions
  • Pre-Homework:  3.1-3.6
  • In class: greet and greet_whole_name
Day 4: Parameters
  • Pre-homework: 3.7-3.9
  • In class: print_product, print_energy, TurtleWorld introduction
(The end of chapter 3 and beginning of 4 are covered in a lab, so we skip to...)
Day 5: Generalization and Interfaces
  • Pre-homework: 4.6-4.8
  • In class: bob_draw_square, bob_draw_hexagon, draw_square, draw_hexagon, draw_polygon, draw_box_stack 
Day 6: Modulus and Booleans
  • Pre-homework: 5.1-5.3
  • In class: print_about_positivity, print_whether_in_closed_interval
Day 7: Conditionals
  • Pre-homework: 5.4, 5.5
  • better_print_whether_in_closed_interval, draw_polygon (improved)
Day 8: Chained and Nested Conditionals
  • Pre-homework: 5.6, 5.7
  • print_about_sign, print_about_integer, print_about_turtle
Day 9 & 10: Recursion
  • Pre-homework: 5.8-5.10
  • final_countdown, count_to, green_prompt, is_between_prompt, is_between_keep_asking, is_between_maybe_keep_asking
Day 11: Return Values
  • Pre-homework: 6.1
  • In class: area_of_triangle, volume_of_cylinder, absolute_value
Day 12: Composition and Boolean Functions
  • Pre-homework: 6.2-6.4
  • In class: is_even, is_odd, is_between, area_of_rectangle_between_points
Day 13: Fruitful Recursion (this usually leaks over a bit into the following day too)
  • Pre-homework: 6.5, 6.6, 6.9
  • In class: Go over this carefully
Day 14: Guardians and Reassignment
  • Pre-homework: 6.8, 7.1, 7.2
  • In class: fix fibonacci, is_integer,
Day 15: while and break
  • Pre-homework: 7.3, 7.4
  • In class: print_monkeys, print_fibonacci_sequence, multiply,
Day 16: Algorithms
  • Pre-homework: 7.5 - 7.7
  • In class: square_root_from_guess, my_square_root, my_pi
Day 17: Midterm

Day 18: Strings and len
  • Pre-homework: 8.1, 8.2
  • In class: middle_char, first_characters, extend_string, middle_chars

Day 19: String Traversal
  • Pre-homework: 8.3
  • In class: print_duckling_names, has_vowels

Day 20: String Slices
  • Pre-homework: 8.4-8.5
  • In class: print_start_slices_of, starts_with

Day 21: Search and Counting
  • Pre-homework: 8.6, 8.7
  • In class: find, count, find_last, max_count,

Day 22: String Methods and in
  • Pre-homework: 8.9, 8.9
  • In class: to_fancy_title, in_both, in_all_three, in_two_of_three, repeated_charcters

Day 23: String Comparisons
  • Pre-homework: 8.10, 8.11
  • In class: earlier_string (I need more here!)

Day 24: Lists
  • Pre-homework: 10.1 - 10.4
  • In class: swap_ends, to_strings, get_ones, get_reverse_of

Day 25: List Slices and Methods
  • Pre-homework: 10.5, 10.6
  • In class: reverse_middle, revers_sort, double_list

Day 26: List Functions
  • Pre-homework: 10.7
  • In class: list_sum, list_max, all_lower_case, add_five_to_all, only_odds (too many... finish them in the next class)

Day 27: List Deleting and References
  • Pre-homework: 10.8 - 10.13
  • In class: remove_evens

Day 28: Classes and Attributes
  • Pre-homework: 15.1 - 15.6
  • In class: Pokemon class, has_full_hp, print_pokemon, heal_up

Day 29: Functions on Objects
  • Pre-homework: 16.1 - 16.4
  • In class:  create_pokemon, get_first, order_pokemon, get_fainted

Day 30: Creating Methods
  • Pre-homework: 17.1 - 17.4
  • In class:  print, has_full_hp, is_fainted, is_after

Day 31: Constructors
  • Pre-homework: 17.5
  • In class:  initialize, __init__, GeographicCoordinate.__init__

Day 32: __str__
  • Pre-homework: 17.6, 17.7
  • In class:  Pokemon.__str__, GeographicCoordinate.__str__, Mountain, taller_than, WeatherReport

Day 33: Inheritance
  • Pre-homework: 18.1-18.7
  • In class:  Volcano class

Day 34: More Inheritance
  • Pre-homework: more exercises I came up with
  • In class:  is_active, add_eruption

Day 35: Polymorphism
  • Pre-homework: An exercise I made.
  • In class:  ActiveVolcano and DormantVolcano
Extra days: Go back and cover the chapters we skipped or dig further into the book.  I usually find that I need extra days during the semester to cover things or let students catch up on projects.

I hope this is useful for someone!

0 Comments:

Post a Comment

<< Home