Community Data Science Workshops (Fall 2014)/Day 1 lecture: Difference between revisions
Content added Content deleted
imported>Mako |
imported>Mako |
||
Line 36: | Line 36: | ||
** e.g., <code>"i" in "team"</code> |
** e.g., <code>"i" in "team"</code> |
||
** e.g., "i" not in "team"</code> |
** e.g., "i" not in "team"</code> |
||
* <tt>if</tt>/<tt>elif</tt>/<tt>else</tt> |
* <tt>if</tt>/<tt>elif</tt>/<tt>else</tt> ('''move to external file''') |
||
** if, something that evaluates to a boolean, and then colon |
** if, something that evaluates to a boolean, and then colon |
||
** e.g., <code>if "mako" in "makoshark"</code> |
** e.g., <code>if "mako" in "makoshark"</code> |
||
** e.g., adding else example: < |
** e.g., adding else example: <code>if brother_age > sister_age</code> mako older |
||
** e.g., tempreature range |
|||
** e.g., adding elif: fix the bug in the previous program if they were the same age |
|||
** indent with spaces (we use 4 spaces!) |
** indent with spaces (we use 4 spaces!) |
||
* functions |
* functions |