Anonymous user
Community Data Science Workshops (Fall 2014)/Day 1 lecture: Difference between revisions
Community Data Science Workshops (Fall 2014)/Day 1 lecture (view source)
Revision as of 17:31, 8 November 2014
, 9 years ago→loops and more flow control
imported>Mako (→Lists) |
imported>Mako |
||
Line 85:
* <tt>for</tt> loops
** e.g., <code>for name in names: print name</code>
** e.g., <code>for name in names: print 'hello ' + name</code>
** 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.'''
* <tt>if</tt> statements inside <tt>for</tt> loops
* nested <tt>for</tt> loops
|