Matplotlib: Difference between revisions

1,878 bytes removed ,  10 years ago
no edit summary
imported>Jesstess
imported>Jesstess
No edit summary
</li>
</ul>
 
=== 4. Tweak the existing Jeopardy scripts ===
 
==== 1. Modify <code>jeopardy_categories.py</code> to print both the category and game number ====
 
<b>tip</b>: Remind yourself of the <code>categories</code> schema by running <code>.schema category</code> at a sqlite prompt.
<br />
 
<br>Example output</b>:
<pre>Example categories:
 
DETECTIVE FICTION (game #1)
THE OLD TESTAMENT (game #2)
ASIAN HISTORY (game #4)
RIVER SOURCES (game #5)
WORLD RELIGION (game #3)
SEAN SONG (game #2)
ANIMATED MOVIES (game #1)
NEW YORK CITY (game #6)
AFRICAN WILDLIFE (game #7)
LITTLE RED RIDING HOOD (game #8)</pre>
 
==== 2. Modify <code>jeopardy_clues.py</code> to only print clues with an $800 value. ====
 
A good way to achieve this is by adding a <code>WHERE</code> clause to the SQL query in <code>jeopardy_clues.py</code>.
 
Read about <code>WHERE</code> clauses in this short document:
* The WHERE Clause: http://www.w3schools.com/sql/sql_where.asp
 
<br />
<b>Example output</b>:
 
<pre>Example clues:
 
[$800]
A: She also created the detectives Tuppence &amp; Tommy Beresford
Q: What is 'Agatha Christie'
 
[$800]
A: According to this Old Testament book, this &quot;swords into plowshares&quot; prophet walked naked for 3 years
Q: What is 'Isaiah'
...</pre>
 
 
=== 5. Daily Doubles ===
 
Write a script that prints 10 daily doubles and their responses.
 
<br />
<b>tip</b>: The <code>clue</code> table has an <code>isDD</code> field.
 
<br />
<b>Example output</b>:
 
<pre>Category: NEW YORK CITY
Question: The heart of Little Italy is this street also found in a Dr. Seuss book title
Answer: Mulberry Street
===
Category: RIVER SOURCES
Question: This Mideastern boundary river rises on the slopes of Mount Hermon
Answer: the Jordan
===
Category: ROOM
Question: The Titanic has 3 rooms for this--only men were allowed there, as women weren't supposed to do it in public
Answer: smoking
...</pre>
 
==Bonus exercises==
Anonymous user