Jump to content

Shakespeare: Difference between revisions

(5 intermediate revisions by the same user not shown)
>>> lv_counter = 0;
6. Use a for loop (or while loop, if you like) to read through the lines of the file. While you are reading each line, count the number of lines that contains the word "love"
7. Does Shakespeare use a lot of love in his plays? How about other synonyms of "love"?
<b>List & Iteration Exercise 2:</b>
* In the same file that you created from exercise 1 (or start a new file, but don't forget to importin the originalprevious one).exercise:
* Count how many times has <b> <OBERON> </b>has spokespoken.
* Print to screen the name <b><OBERON></b> and the number of times he spoke.
<b>Demo: Which of Shakespeare's famous tragic heros talks the most?</b>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.