Community Data Science Workshops (Fall 2014)/Day 1 lecture: Difference between revisions
Content added Content deleted
imported>Mako |
imported>Mako |
||
Line 19: | Line 19: | ||
#** assignment of variaibles |
#** assignment of variaibles |
||
#** e.g., math with variables: scale up a recipe, into an assignment |
#** e.g., math with variables: scale up a recipe, into an assignment |
||
#** you can assign to a variable and it will replace the old value |
|||
#* strings |
#* strings |
||
#** things within quotation marks |
#** things within quotation marks |
||
Line 26: | Line 27: | ||
#** 1 is different than "1"; name is different than "name" |
#** 1 is different than "1"; name is different than "name" |
||
#** single quotes versus double quotes (python doesn't care) |
#** single quotes versus double quotes (python doesn't care) |
||
#** you can also multiply strings! (although it's not clear why you want to weird) |
|||
#* booleans |
#* booleans |
||
#* <tt>if</tt>/<tt>elif</tt>/<tt>else</tt> |
#* <tt>if</tt>/<tt>elif</tt>/<tt>else</tt> |
||
#* functions |
#* functions |
||
#** has a parentheses |
|||
#** exit(), help(), type() |
|||
#** we've already learnd examples of this: exit(), help(), type() |
|||
# lists |
# lists |
||
#* purpose |
#* purpose |
||
Line 39: | Line 42: | ||
#* slicing lists |
#* slicing lists |
||
#* strings are like lists |
#* strings are like lists |
||
#** len() |
|||
# loops and more flow control |
# loops and more flow control |
||
#* <tt>for</tt> loops |
#* <tt>for</tt> loops |