Editing DS4UX (Spring 2016)/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 1: | Line 1: | ||
== Resources == | |||
* [[Python data types cheat sheet]] | |||
* [[Python loops cheat sheet]] | |||
* [http://mako.cc/teaching/2015/cdsw-spring/state_capitals.py state_capitals.py] -- the state capitals example. | |||
* [http://communitydata.cc/~mako/cdsw-au2015-lecture1-20151010.ogv cdsw-au2015-lecture1-20151010.ogv] -- Professor Mako Hill's lecture video, which covers most of the concepts from today's lecture. | |||
== Part 1: Review == | == Part 1: Review == | ||
* math: using python as a calculator | * math: using python as a calculator | ||
Line 73: | Line 80: | ||
=== loops and more flow control === | === loops and more flow control === | ||
* <tt>for</tt> loops | * <tt>for</tt> loops | ||
Line 95: | Line 101: | ||
* <tt>break</tt> | * <tt>break</tt> | ||
* <tt>input()</tt> | * <tt>input()</tt> | ||
=== dictionaries === | |||
* purpose | |||
* initialization | |||
* accessing elements | |||
* adding elements | |||
* changing elements | |||
* <tt>keys()</tt> and <tt>values()</tt> | |||
=== modules === | === modules === | ||
* purpose | * purpose | ||
* builtins | * builtins | ||
* imports | |||
* <tt>import random</tt> | * <tt>import random</tt> | ||
* <tt>random.randint</tt> | * <tt>random.randint</tt> | ||
* <tt>random.choice</tt> | * <tt>random.choice</tt> | ||
=== walk through | === walk through state_capitals.py === | ||
Where state_capitals.py from http://mako.cc/teaching/2015/cdsw-spring/state_capitals.py is the grand finale and synthesis of lecture material. | |||
[[Category:DS4UX (Spring 2016)]] | [[Category:DS4UX (Spring 2016)]] |