O'Reilly Introduction to Python/Section 10: Difference between revisions
Content added Content deleted
imported>Jesstess (Created page with "__NOTOC__ == Section material == * [http://web.mit.edu/jesstess/www/OReillyPython/Section10/state_capitals.py state_capitals.py] [[O'Reilly Introduction to Python|« ...") |
imported>Jesstess No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ |
__NOTOC__ |
||
== Goal #1: review the state capitals quizzer == |
|||
== Section material == |
|||
(Estimated completion time: 5 - 10 minutes) |
|||
Download the state capitals quizzer demoed in the video: |
|||
* [http://web.mit.edu/jesstess/www/OReillyPython/Section10/state_capitals.py state_capitals.py] |
* [http://web.mit.edu/jesstess/www/OReillyPython/Section10/state_capitals.py state_capitals.py] |
||
<ol> |
|||
<li>Download the script and save it to your Desktop. Be sure to save it as a <code>.py</code> file.</li> |
|||
<li>Open the script in your text editor.</li> |
|||
<li>Read through the script. Think about these questions: |
|||
<ul> |
|||
<li>Why do we use a dictionary to store the states and capitals?</li> |
|||
<li>What is the purpose of the variable <tt>i</tt> in the <tt>for</tt> loop?</li> |
|||
<li>What is the purpose of the <tt>input</tt> function?</li> |
|||
</ul> |
|||
</li> |
|||
</ol> |
|||
[[O'Reilly Introduction to Python|« Back to the section index]] |
[[O'Reilly Introduction to Python|« Back to the section index]] |