Shakespeare: Difference between revisions

imported>Zanwenhuahao
imported>Zanwenhuahao
Line 63:
=====<font color="navy">Using the word "love"</font>=====
* We will use the play <b> Romeo and Juliet </b>
1. Make a python program, call it <code> RomeoJulietRom_Juli.py</code> save it under the same directory as where you've saved the Shakespearean texts.
 
2. Import RomeoJuliet
2. In your program, open the file "Romeo and Juliet.txt" (The text file need to be saved in the same directory as your python program to be able to use local file name)
 
3. The variable RomeoJuliet is the play - don't out put it, too long. It's in a list.
3. Check to see that the file was opened properly
 
4. Now create a variable that represents the string "love", for example:
Anonymous user