Community Data Science Workshops (Fall 2014)/Day 1 lecture

Welcome to the Saturday lecture section of the Community Data Science Workshop! For about 2 hours, we'll work through an introduction to the Python programming language via both a lecture and hand-on exercises.

Resources

 * Python data types cheat sheet
 * Python loops cheat sheet
 * state_capitals.py -- the state capitals example.

Lecture outline

 * 1) review Friday material
 * 2) * math: using python as a calculator
 * 3) **addition, subtraction, multiplication, division
 * 4) **division shows something different: 8/2 versus 1/2
 * 5) * type
 * 6) ** there are different types of things in python (called objects)
 * 7) ** variables that "know about the decimal place" (int) and variables that don't (floats)
 * 8) * variables
 * 9) ** assignment of variaibles
 * 10) ** e.g., math with variables: scale up a recipe, into an assignment
 * 11) * strings
 * 12) * booleans
 * 13) * if/elif/else
 * 14) * functions
 * 15) ** exit, help, type
 * 16) lists
 * 17) * purpose
 * 18) * initialization
 * 19) * len review
 * 20) * accessing elements
 * 21) * adding elements
 * 22) * changing elements
 * 23) * slicing lists
 * 24) * strings are like lists
 * 25) loops and more flow control
 * 26) * for loops
 * 27) * if statements inside for loops
 * 28) * nested for</tt> loops
 * 29) * range</tt>
 * 30) * while</tt> loops
 * 31) * infinite loops
 * 32) * if</tt> statements inside while</tt> loops
 * 33) * break</tt>
 * 34) * raw_input</tt>
 * 35) dictionaries
 * 36) * purpose
 * 37) * initialization
 * 38) * accessing elements
 * 39) * adding elements
 * 40) * changing elements
 * 41) * keys</tt> and values</tt>
 * 42) modules
 * 43) * purpose
 * 44) * builtins
 * 45) * imports
 * 46) * import random</tt>
 * 47) * random.randint</tt>
 * 48) * random.choice</tt>
 * 49) * walk through state_capitals.py

Where state_capitals.py from http://mako.cc/teaching/2014/cdsw/state_capitals.py is the grand finale and synthesis of lecture material.