Editing Community Data Science Course (Spring 2017)/Day 2 Lecture
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 41: | Line 41: | ||
** e.g., adding elif: fix the bug in the previous program if they were the same age | ** 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 | |||
** has a parentheses | |||
** we've already learned examples of this: exit(), help(), type() | |||
=== Lists === | === Lists === | ||
Line 76: | Line 79: | ||
** e.g., <code>min()</code> and <code>max()</code> | ** e.g., <code>min()</code> and <code>max()</code> | ||
** e.g., create a list of names and sort it <code>names.sort()</code> | ** e.g., create a list of names and sort it <code>names.sort()</code> | ||
=== loops and more flow control === | === loops and more flow control === | ||
Line 105: | Line 102: | ||
* <tt>break</tt> | * <tt>break</tt> | ||
* <tt>input()</tt> | * <tt>input()</tt> | ||
=== (briefly) modules === | |||
* purpose | |||
* builtins | |||
* imports | |||
* <tt>import random</tt> | |||
* <tt>random.randint</tt> | |||
* <tt>random.choice</tt> |