string


In [1]:
ls


 Volume in drive C has no label.
 Volume Serial Number is A8BF-C894

 Directory of C:\Users\Wasit\Documents\GitHub\cs439_python\week02

02/02/2017  15:18    <DIR>          .
02/02/2017  15:18    <DIR>          ..
02/02/2017  15:12    <DIR>          .ipynb_checkpoints
02/02/2017  15:18             4,084 little_red_rading_hood.txt
01/02/2017  14:14            19,071 week02.ipynb
02/02/2017  15:14               576 week02_wordcount.ipynb
               3 File(s)         23,731 bytes
               3 Dir(s)  406,375,718,912 bytes free

In [2]:
with open('little_red_rading_hood.txt', 'r') as f:
    read_data = f.read()

In [3]:
read_data


Out[3]:
'Once upon a time there lived in a certain village a little country girl, the prettiest creature who was ever seen. Her mother was excessively fond of her; and her grandmother doted on her still more. This good woman had a little red riding hood made for her. It suited the girl so extremely well that everybody called her Little Red Riding Hood.\nOne day her mother, having made some cakes, said to her, "Go, my dear, and see how your grandmother is doing, for I hear she has been very ill. Take her a cake, and this little pot of butter."\n\nLittle Red Riding Hood set out immediately to go to her grandmother, who lived in another village.\n\nAs she was going through the wood, she met with a wolf, who had a very great mind to eat her up, but he dared not, because of some woodcutters working nearby in the forest. He asked her where she was going. The poor child, who did not know that it was dangerous to stay and talk to a wolf, said to him, "I am going to see my grandmother and carry her a cake and a little pot of butter from my mother."\n\n"Does she live far off?" said the wolf\n\n"Oh I say," answered Little Red Riding Hood; "it is beyond that mill you see there, at the first house in the village."\n\n"Well," said the wolf, "and I\'ll go and see her too. I\'ll go this way and go you that, and we shall see who will be there first."\n\nThe wolf ran as fast as he could, taking the shortest path, and the little girl took a roundabout way, entertaining herself by gathering nuts, running after butterflies, and gathering bouquets of little flowers. It was not long before the wolf arrived at the old woman\'s house. He knocked at the door: tap, tap.\n\n"Who\'s there?"\n\n"Your grandchild, Little Red Riding Hood," replied the wolf, counterfeiting her voice; "who has brought you a cake and a little pot of butter sent you by mother."\n\nThe good grandmother, who was in bed, because she was somewhat ill, cried out, "Pull the bobbin, and the latch will go up."\n\nThe wolf pulled the bobbin, and the door opened, and then he immediately fell upon the good woman and ate her up in a moment, for it been more than three days since he had eaten. He then shut the door and got into the grandmother\'s bed, expecting Little Red Riding Hood, who came some time afterwards and knocked at the door: tap, tap.\n\n"Who\'s there?"\n\nLittle Red Riding Hood, hearing the big voice of the wolf, was at first afraid; but believing her grandmother had a cold and was hoarse, answered, "It is your grandchild Little Red Riding Hood, who has brought you a cake and a little pot of butter mother sends you."\n\nThe wolf cried out to her, softening his voice as much as he could, "Pull the bobbin, and the latch will go up."\n\nLittle Red Riding Hood pulled the bobbin, and the door opened.\n\nThe wolf, seeing her come in, said to her, hiding himself under the bedclothes, "Put the cake and the little pot of butter upon the stool, and come get into bed with me."\n\nLittle Red Riding Hood took off her clothes and got into bed. She was greatly amazed to see how her grandmother looked in her nightclothes, and said to her, "Grandmother, what big arms you have!"\n\n"All the better to hug you with, my dear."\n\n"Grandmother, what big legs you have!"\n\n"All the better to run with, my child."\n\n"Grandmother, what big ears you have!"\n\n"All the better to hear with, my child."\n\n"Grandmother, what big eyes you have!"\n\n"All the better to see with, my child."\n\n"Grandmother, what big teeth you have got!"\n\n"All the better to eat you up with."\n\nAnd, saying these words, this wicked wolf fell upon Little Red Riding Hood, and ate her all up.\n\nMoral: Children, especially attractive, well bred young ladies, should never talk to strangers, for if they should do so, they may well provide dinner for a wolf. I say "wolf," but there are various kinds of wolves. There are also those who are charming, quiet, polite, unassuming, complacent, and sweet, who pursue young women at home and in the streets. And unfortunately, it is these gentle wolves who are the most dangerous ones of all.'

In [ ]: