User:Jtmorgan/sandbox

Review
mostly covered in coding challenge review?
 * nested data structures
 * 'in'
 * nested loops and conditionals
 * random (example of standard library)

New concepts

 * while loops
 * break and continue
 * string formatting
 * tuples
 * type conversion
 * copying vs. changing a data structure in-place, see: http://openbookproject.net/thinkcs/python/english3e/tuples.html


 * dictionaries


 * reading text file formats in/out
 * csv
 * tsv
 * open, read, readlines

Lists

 * purpose
 * Stores things in order
 * initialization
 * making a list called my list:
 * comma separated elements. in python they can be a mix of any kind of types
 * len review
 * accessing elements
 * indexing like my_list[0]
 * indexing starts from the front and we start counting at 0 (now you understand all the zeros we've been using)
 * we go from the end with negative numbers
 * what happens if we try to move outside of the range? ('error!)
 * adding elements
 * using the the  function
 * the  function is a special kind of function that lists know about
 * changing elements
 * replacing elements like
 * finding elements in list
 * e.g.,
 * slicing lists
 * the colon inside the [] is the slicing syntax
 * e.g.,  is 0th up to, but not including, the 2nd
 * e.g.,
 * e.g.,
 * e.g.,
 * strings are like lists
 * we can slice lists
 * len
 * length of the empty string
 * many other interesting functions for lists
 * e.g.,  and
 * e.g., create a list of names and sort it
 * e.g., create a list of names and sort it

loops and more flow control
See also: working within loops.


 * for loops
 * e.g.,
 * e.g.,
 * Super powerful because it can do something many many times. Data science is about doing tedious things very quickly. For is the workhorse that makes this possible.
 * Look and see name is after we're done looping.
 * Move to editor.
 * if statements inside for loops
 * e.g.,  then print "starts with a vowel"
 * show we can test things outside the loop to show how the comparisons are working
 * add an else statement to capture words that start with a consonant
 * append to a list within a for loop
 * create a counter within a for loop (keep track)
 * build up a sentence
 * nested for loops
 * range
 * while loops
 * infinite loops
 * if statements inside while</tt> loops
 * break</tt>
 * input</tt>

modules

 * purpose
 * builtins
 * import random</tt>
 * random.randint</tt>
 * random.choice</tt>
 * random.sample</tt>