Anonymous user
Shakespeare: Difference between revisions
→Lists and Dictionaries Exercises
imported>Zanwenhuahao |
imported>Zanwenhuahao |
||
Line 146:
<b>List & Iteration Exercise 1:</b>
* Create a new python program.
* Import the list of characters from <b> A Midsummer Night's Dream </b>
<pre>
>>> summerChar
# prints all the characters such as <HELENA> that are in the play A Midsummer Night's Dream
</pre>
<b>List & Iteration Exercise 2:</b>
* In the same program that you created from exercise 1 (or start a new file, but don't forget to import
*
* Print to screen the name <OBERON> and the number of times he spoke.
<b>Demo: Which of Shakespeare's famous tragic heros talks the most?</b>
<b>List & Iteration Exercise 3*:</b>
* Now iterate through the list of character you saved from exercise 1, see how many times each of them speak.
* Print to screen each character's name and the number of times they spoke.
<b>List & Iteration Exercise 4**:</b>
|