SlideShare a Scribd company logo
1 of 2
Download to read offline
Previously answered code did not work please make sure it runs and explain each line of source
code.
Lab 6: Text parsing (Python) Objective Count the number of words, characters and identify
patterns in a string. Use this story.txt for parsing.
Action
1. Count the number of words and characters in a string using a list data structure. Create a
histogram of words in any software of your choice.
2. Repeat step 1 and use a dictionary data structure.
3. Use regular expressions and extract phone numbers and email addresses in a string. The
phone numbers and email addresses should be saved in a separate list data structure.
4. Extract the username from the email addresses saved in a list data structure in step 3 and
append @hotmail.com at the end of the extracted usernames.
Story in the text file:
Once on a time and twice on a time, and all times together as ever I heard tell of, there was a tiny
lassie who would weep all day to have the stars in the sky to play with; she wouldnt have this, and
she wouldnt have that, but it was always the stars she would have. So one fine day off she went to
find them. And she walked and she walked and she walked, till by-and-by she came to a mill-dam.
Goodeen to ye, says she, Im seeking the stars in the sky to play with. Have you seen any? Oh,
yes, my bonnie lassie, said the mill-dam. They shine in my own face o nights till I cant sleep for
them. Jump in and perhaps youll find one. So she jumped in, and swam about and swam about
and swam about, but neer a one could she see. So she went on till she came to a brooklet.
Goodeen to ye, Brooklet, Brooklet, says she; Im seeking the stars in the sky to play with. Have you
seen any? Yes, indeed, my bonny lassie, said the Brooklet. They glint on my banks at night.
Paddle about, and maybe youll find one. So she paddled and she paddled and she paddled, but
neer a one did she find. So on she went till she came to the Good Folk. Goodeen to ye, Good
Folk, says she; Im looking for the stars in the sky to play with. Have ye seen eer a one? Why, yes,
my bonny lassie, said the Good Folk. They shine on the grass here o night. Dance with us, and
maybe youll find one. And she danced and she danced and she danced, but neer a one did she
see. So down she sate; I suppose she wept. Oh dearie me, oh dearie me, says she, Ive swam and
Ive paddled and Ive danced, and if yell not help me I shall never find the stars in the sky to play
with. But the Good Folk whispered together, and one of them came up to her and took her by the
hand and said, If you wont go home to your mother, go forward, go forward; mind you take the
right road. Ask Four Feet to carry you to No Feet at all, and tell No Feet at all to carry you to the
stairs without steps, and if you can climb that Oh, shall I be among the stars in the sky then? cried
the lassie. If youll not be, then youll be elsewhere, said the Good Folk, and set to dancing again.
So on she went again with a light heart, and by-and-by she came to a saddled horse, tied to a
tree. Goodeen to ye, Beast, said she; Im seeking the stars in the sky to play with. Will you give me
a lift, for all my bones are an-aching. Nay, said the horse, I know nought of the stars in the sky,
and Im here to do the bidding of the Good Folk, and not my own will. Well, said she, its from the
Good Folk I come, and they bade me tell Four Feet to carry me to No Feet at all. Thats another
story, said he; jump up and ride with me. So they rode and they rode and they rode, till they got
out of the forest and found themselves at the edge of the sea. And on the water in front of them
was a wide glistening path running straight out towards a beautiful thing that rose out of the water
and went up into the sky, and was all the colours in the world, blue and red and green, and
wonderful to look at. Now get you down, said the horse; Ive brought ye to the end of the land, and
thats as much as Four Feet can do. I must away home to my own folk. But, said the lassie, wheres
No Feet at all, and wheres the stair without steps? I know not, said the horse, its none of my
business neither. So goodeen to ye, my bonny lassie; and off he went. So the lassie stood still and
looked at the water, till a strange kind of fish came swimming up to her feet. Goodeen to ye, big
Fish, says she, Im looking for the stars in the sky, and for the stairs that climb up to them. Will ye
show me the way? Nay, said the Fish, I cant unless you bring me word from the Good Folk. Yes,
indeed, said she. They said Four Feet would bring me to No Feet at all, and No Feet at all would
carry me to the stairs without steps. Get on my back and hold fast. Ah, well, said the Fish; thats all
right then. Get on my back and hold fast. And off he wentKerplash!into the water, along the silver
path, towards the bright arch. And the nearer they came the brighter the sheen of it, till she had to
shade her eyes from the light of it. And as they came to the foot of it, she saw it was a broad bright
road, sloping up and away into the sky, and at the far, far end of it she could see wee shining
things dancing about. Now, said the Fish, here you are, and yons the stair; climb up, if you can,
but hold on fast. Ill warrant you find the stair easier at home than by such a way; t was neer meant
for lassies feet to travel; and off he splashed through the water. So she clomb and she clomb and
she clomb, but neer a step higher did she get: the light was before her and around her, and the
water behind her, and the more she struggled the more she was forced down into the dark and the
cold, and the more she clomb the deeper she fell. But she clomb and she clomb, till she got dizzy
in the light and shivered with the cold, and dazed with the fear; but still she clomb, till at last, quite
dazed and silly-like, she let clean go, and sank downdowndown. And bang she came on to the
hard boards, and found herself sitting, weeping and wailing, by the bedside at home all alone. -----
The story is written by Roger Federer & Serina Williams You can connect with the author at
[rfederer@tennis.com] and [swilliams@tennis.com] Admin contact number: 1-888-111-2222

More Related Content

Similar to Previously answered code did not work please make sure it ru.pdf

Similar to Previously answered code did not work please make sure it ru.pdf (20)

Ark Media v1 Crosswalk and Load Intervals
Ark Media v1 Crosswalk and Load IntervalsArk Media v1 Crosswalk and Load Intervals
Ark Media v1 Crosswalk and Load Intervals
 
Ark Media V2 Glass Model Confection
Ark Media V2 Glass Model ConfectionArk Media V2 Glass Model Confection
Ark Media V2 Glass Model Confection
 
Overstatement
OverstatementOverstatement
Overstatement
 
The sound of poetry
The sound of poetryThe sound of poetry
The sound of poetry
 
Poems
PoemsPoems
Poems
 
Favorite poems of Second Grade
Favorite poems of Second GradeFavorite poems of Second Grade
Favorite poems of Second Grade
 
Go, and Catch a Falling Star
Go, and Catch a Falling StarGo, and Catch a Falling Star
Go, and Catch a Falling Star
 
眾神列傳之Leonard Cohen(下)── 聚歌成塔的智者
眾神列傳之Leonard Cohen(下)── 聚歌成塔的智者眾神列傳之Leonard Cohen(下)── 聚歌成塔的智者
眾神列傳之Leonard Cohen(下)── 聚歌成塔的智者
 
English
EnglishEnglish
English
 
C pelt session 3 (1)
C pelt session 3 (1)C pelt session 3 (1)
C pelt session 3 (1)
 
5_Forever A Disney Princess
5_Forever A Disney Princess5_Forever A Disney Princess
5_Forever A Disney Princess
 
Go and Catch a Falling Star (Poem)
Go and Catch a Falling Star (Poem)Go and Catch a Falling Star (Poem)
Go and Catch a Falling Star (Poem)
 
Sinatra musical
Sinatra musicalSinatra musical
Sinatra musical
 
Choral speaking workshop
Choral speaking workshopChoral speaking workshop
Choral speaking workshop
 
Choral speaking workshop
Choral speaking workshopChoral speaking workshop
Choral speaking workshop
 
Choral speaking workshop
Choral speaking workshopChoral speaking workshop
Choral speaking workshop
 
CHORAL SPEAKING WORKSHOP ESU PART 1
CHORAL SPEAKING WORKSHOP ESU PART 1CHORAL SPEAKING WORKSHOP ESU PART 1
CHORAL SPEAKING WORKSHOP ESU PART 1
 
poem.docx
poem.docxpoem.docx
poem.docx
 
gate 1
gate 1gate 1
gate 1
 
Startaward 2017
Startaward 2017Startaward 2017
Startaward 2017
 

More from sandeep252523

A population of values has a normal distribution with 1309.pdf
A population of values has a normal distribution with 1309.pdfA population of values has a normal distribution with 1309.pdf
A population of values has a normal distribution with 1309.pdfsandeep252523
 
Assume that the local newspaper just ran the following headl.pdf
Assume that the local newspaper just ran the following headl.pdfAssume that the local newspaper just ran the following headl.pdf
Assume that the local newspaper just ran the following headl.pdfsandeep252523
 
Python It is common for images of a countrys previous leade.pdf
Python It is common for images of a countrys previous leade.pdfPython It is common for images of a countrys previous leade.pdf
Python It is common for images of a countrys previous leade.pdfsandeep252523
 
Bir firma iin ksa vadeli maliyet erilerinin tamam bize .pdf
Bir firma iin ksa vadeli maliyet erilerinin tamam bize  .pdfBir firma iin ksa vadeli maliyet erilerinin tamam bize  .pdf
Bir firma iin ksa vadeli maliyet erilerinin tamam bize .pdfsandeep252523
 
Answers the Questions below To be submitted through the cla.pdf
Answers the Questions below To be submitted through the cla.pdfAnswers the Questions below To be submitted through the cla.pdf
Answers the Questions below To be submitted through the cla.pdfsandeep252523
 
Question 2 Banking and the Federal Reserve Consider a bank .pdf
Question 2 Banking and the Federal Reserve Consider a bank .pdfQuestion 2 Banking and the Federal Reserve Consider a bank .pdf
Question 2 Banking and the Federal Reserve Consider a bank .pdfsandeep252523
 
3121 Periodically assess the security controls in organiza.pdf
3121 Periodically assess the security controls in organiza.pdf3121 Periodically assess the security controls in organiza.pdf
3121 Periodically assess the security controls in organiza.pdfsandeep252523
 
Vaka almas Teknoloji Sears Kurtarabilir mi Sears Roebuc.pdf
Vaka almas Teknoloji Sears Kurtarabilir mi  Sears Roebuc.pdfVaka almas Teknoloji Sears Kurtarabilir mi  Sears Roebuc.pdf
Vaka almas Teknoloji Sears Kurtarabilir mi Sears Roebuc.pdfsandeep252523
 
Given the data x1y1x2y2xnyn best fitting data .pdf
Given the data x1y1x2y2xnyn best fitting data .pdfGiven the data x1y1x2y2xnyn best fitting data .pdf
Given the data x1y1x2y2xnyn best fitting data .pdfsandeep252523
 
Match the investment concept to its definition diversificati.pdf
Match the investment concept to its definition diversificati.pdfMatch the investment concept to its definition diversificati.pdf
Match the investment concept to its definition diversificati.pdfsandeep252523
 
The figure below illustrates positive externalities of educa.pdf
The figure below illustrates positive externalities of educa.pdfThe figure below illustrates positive externalities of educa.pdf
The figure below illustrates positive externalities of educa.pdfsandeep252523
 
All of the following are risk factors that lead to endotheli.pdf
All of the following are risk factors that lead to endotheli.pdfAll of the following are risk factors that lead to endotheli.pdf
All of the following are risk factors that lead to endotheli.pdfsandeep252523
 
The arbiter of Example 72 controls access to a common resou.pdf
The arbiter of Example 72 controls access to a common resou.pdfThe arbiter of Example 72 controls access to a common resou.pdf
The arbiter of Example 72 controls access to a common resou.pdfsandeep252523
 
The following information is available for two samples selec.pdf
The following information is available for two samples selec.pdfThe following information is available for two samples selec.pdf
The following information is available for two samples selec.pdfsandeep252523
 
Review the following case study and make an action plan for .pdf
Review the following case study and make an action plan for .pdfReview the following case study and make an action plan for .pdf
Review the following case study and make an action plan for .pdfsandeep252523
 
Question 14 Time extensions are typically granted for avoida.pdf
Question 14 Time extensions are typically granted for avoida.pdfQuestion 14 Time extensions are typically granted for avoida.pdf
Question 14 Time extensions are typically granted for avoida.pdfsandeep252523
 
Please help with an SQL error The result tableset should l.pdf
Please help with an SQL error The result tableset should l.pdfPlease help with an SQL error The result tableset should l.pdf
Please help with an SQL error The result tableset should l.pdfsandeep252523
 
Question Need to have proper explanation for each and every.pdf
Question Need to have proper explanation for each and every.pdfQuestion Need to have proper explanation for each and every.pdf
Question Need to have proper explanation for each and every.pdfsandeep252523
 
Evaluate the impact of governments responses to the pandemi.pdf
Evaluate the impact of governments responses to the pandemi.pdfEvaluate the impact of governments responses to the pandemi.pdf
Evaluate the impact of governments responses to the pandemi.pdfsandeep252523
 
parts a through c below Cick the ison to view the tabie.pdf
parts a through c below Cick the ison to view the tabie.pdfparts a through c below Cick the ison to view the tabie.pdf
parts a through c below Cick the ison to view the tabie.pdfsandeep252523
 

More from sandeep252523 (20)

A population of values has a normal distribution with 1309.pdf
A population of values has a normal distribution with 1309.pdfA population of values has a normal distribution with 1309.pdf
A population of values has a normal distribution with 1309.pdf
 
Assume that the local newspaper just ran the following headl.pdf
Assume that the local newspaper just ran the following headl.pdfAssume that the local newspaper just ran the following headl.pdf
Assume that the local newspaper just ran the following headl.pdf
 
Python It is common for images of a countrys previous leade.pdf
Python It is common for images of a countrys previous leade.pdfPython It is common for images of a countrys previous leade.pdf
Python It is common for images of a countrys previous leade.pdf
 
Bir firma iin ksa vadeli maliyet erilerinin tamam bize .pdf
Bir firma iin ksa vadeli maliyet erilerinin tamam bize  .pdfBir firma iin ksa vadeli maliyet erilerinin tamam bize  .pdf
Bir firma iin ksa vadeli maliyet erilerinin tamam bize .pdf
 
Answers the Questions below To be submitted through the cla.pdf
Answers the Questions below To be submitted through the cla.pdfAnswers the Questions below To be submitted through the cla.pdf
Answers the Questions below To be submitted through the cla.pdf
 
Question 2 Banking and the Federal Reserve Consider a bank .pdf
Question 2 Banking and the Federal Reserve Consider a bank .pdfQuestion 2 Banking and the Federal Reserve Consider a bank .pdf
Question 2 Banking and the Federal Reserve Consider a bank .pdf
 
3121 Periodically assess the security controls in organiza.pdf
3121 Periodically assess the security controls in organiza.pdf3121 Periodically assess the security controls in organiza.pdf
3121 Periodically assess the security controls in organiza.pdf
 
Vaka almas Teknoloji Sears Kurtarabilir mi Sears Roebuc.pdf
Vaka almas Teknoloji Sears Kurtarabilir mi  Sears Roebuc.pdfVaka almas Teknoloji Sears Kurtarabilir mi  Sears Roebuc.pdf
Vaka almas Teknoloji Sears Kurtarabilir mi Sears Roebuc.pdf
 
Given the data x1y1x2y2xnyn best fitting data .pdf
Given the data x1y1x2y2xnyn best fitting data .pdfGiven the data x1y1x2y2xnyn best fitting data .pdf
Given the data x1y1x2y2xnyn best fitting data .pdf
 
Match the investment concept to its definition diversificati.pdf
Match the investment concept to its definition diversificati.pdfMatch the investment concept to its definition diversificati.pdf
Match the investment concept to its definition diversificati.pdf
 
The figure below illustrates positive externalities of educa.pdf
The figure below illustrates positive externalities of educa.pdfThe figure below illustrates positive externalities of educa.pdf
The figure below illustrates positive externalities of educa.pdf
 
All of the following are risk factors that lead to endotheli.pdf
All of the following are risk factors that lead to endotheli.pdfAll of the following are risk factors that lead to endotheli.pdf
All of the following are risk factors that lead to endotheli.pdf
 
The arbiter of Example 72 controls access to a common resou.pdf
The arbiter of Example 72 controls access to a common resou.pdfThe arbiter of Example 72 controls access to a common resou.pdf
The arbiter of Example 72 controls access to a common resou.pdf
 
The following information is available for two samples selec.pdf
The following information is available for two samples selec.pdfThe following information is available for two samples selec.pdf
The following information is available for two samples selec.pdf
 
Review the following case study and make an action plan for .pdf
Review the following case study and make an action plan for .pdfReview the following case study and make an action plan for .pdf
Review the following case study and make an action plan for .pdf
 
Question 14 Time extensions are typically granted for avoida.pdf
Question 14 Time extensions are typically granted for avoida.pdfQuestion 14 Time extensions are typically granted for avoida.pdf
Question 14 Time extensions are typically granted for avoida.pdf
 
Please help with an SQL error The result tableset should l.pdf
Please help with an SQL error The result tableset should l.pdfPlease help with an SQL error The result tableset should l.pdf
Please help with an SQL error The result tableset should l.pdf
 
Question Need to have proper explanation for each and every.pdf
Question Need to have proper explanation for each and every.pdfQuestion Need to have proper explanation for each and every.pdf
Question Need to have proper explanation for each and every.pdf
 
Evaluate the impact of governments responses to the pandemi.pdf
Evaluate the impact of governments responses to the pandemi.pdfEvaluate the impact of governments responses to the pandemi.pdf
Evaluate the impact of governments responses to the pandemi.pdf
 
parts a through c below Cick the ison to view the tabie.pdf
parts a through c below Cick the ison to view the tabie.pdfparts a through c below Cick the ison to view the tabie.pdf
parts a through c below Cick the ison to view the tabie.pdf
 

Recently uploaded

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfElizabeth Walsh
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 

Recently uploaded (20)

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 

Previously answered code did not work please make sure it ru.pdf

  • 1. Previously answered code did not work please make sure it runs and explain each line of source code. Lab 6: Text parsing (Python) Objective Count the number of words, characters and identify patterns in a string. Use this story.txt for parsing. Action 1. Count the number of words and characters in a string using a list data structure. Create a histogram of words in any software of your choice. 2. Repeat step 1 and use a dictionary data structure. 3. Use regular expressions and extract phone numbers and email addresses in a string. The phone numbers and email addresses should be saved in a separate list data structure. 4. Extract the username from the email addresses saved in a list data structure in step 3 and append @hotmail.com at the end of the extracted usernames. Story in the text file: Once on a time and twice on a time, and all times together as ever I heard tell of, there was a tiny lassie who would weep all day to have the stars in the sky to play with; she wouldnt have this, and she wouldnt have that, but it was always the stars she would have. So one fine day off she went to find them. And she walked and she walked and she walked, till by-and-by she came to a mill-dam. Goodeen to ye, says she, Im seeking the stars in the sky to play with. Have you seen any? Oh, yes, my bonnie lassie, said the mill-dam. They shine in my own face o nights till I cant sleep for them. Jump in and perhaps youll find one. So she jumped in, and swam about and swam about and swam about, but neer a one could she see. So she went on till she came to a brooklet. Goodeen to ye, Brooklet, Brooklet, says she; Im seeking the stars in the sky to play with. Have you seen any? Yes, indeed, my bonny lassie, said the Brooklet. They glint on my banks at night. Paddle about, and maybe youll find one. So she paddled and she paddled and she paddled, but neer a one did she find. So on she went till she came to the Good Folk. Goodeen to ye, Good Folk, says she; Im looking for the stars in the sky to play with. Have ye seen eer a one? Why, yes, my bonny lassie, said the Good Folk. They shine on the grass here o night. Dance with us, and maybe youll find one. And she danced and she danced and she danced, but neer a one did she see. So down she sate; I suppose she wept. Oh dearie me, oh dearie me, says she, Ive swam and Ive paddled and Ive danced, and if yell not help me I shall never find the stars in the sky to play with. But the Good Folk whispered together, and one of them came up to her and took her by the hand and said, If you wont go home to your mother, go forward, go forward; mind you take the right road. Ask Four Feet to carry you to No Feet at all, and tell No Feet at all to carry you to the stairs without steps, and if you can climb that Oh, shall I be among the stars in the sky then? cried the lassie. If youll not be, then youll be elsewhere, said the Good Folk, and set to dancing again. So on she went again with a light heart, and by-and-by she came to a saddled horse, tied to a tree. Goodeen to ye, Beast, said she; Im seeking the stars in the sky to play with. Will you give me a lift, for all my bones are an-aching. Nay, said the horse, I know nought of the stars in the sky, and Im here to do the bidding of the Good Folk, and not my own will. Well, said she, its from the Good Folk I come, and they bade me tell Four Feet to carry me to No Feet at all. Thats another story, said he; jump up and ride with me. So they rode and they rode and they rode, till they got out of the forest and found themselves at the edge of the sea. And on the water in front of them
  • 2. was a wide glistening path running straight out towards a beautiful thing that rose out of the water and went up into the sky, and was all the colours in the world, blue and red and green, and wonderful to look at. Now get you down, said the horse; Ive brought ye to the end of the land, and thats as much as Four Feet can do. I must away home to my own folk. But, said the lassie, wheres No Feet at all, and wheres the stair without steps? I know not, said the horse, its none of my business neither. So goodeen to ye, my bonny lassie; and off he went. So the lassie stood still and looked at the water, till a strange kind of fish came swimming up to her feet. Goodeen to ye, big Fish, says she, Im looking for the stars in the sky, and for the stairs that climb up to them. Will ye show me the way? Nay, said the Fish, I cant unless you bring me word from the Good Folk. Yes, indeed, said she. They said Four Feet would bring me to No Feet at all, and No Feet at all would carry me to the stairs without steps. Get on my back and hold fast. Ah, well, said the Fish; thats all right then. Get on my back and hold fast. And off he wentKerplash!into the water, along the silver path, towards the bright arch. And the nearer they came the brighter the sheen of it, till she had to shade her eyes from the light of it. And as they came to the foot of it, she saw it was a broad bright road, sloping up and away into the sky, and at the far, far end of it she could see wee shining things dancing about. Now, said the Fish, here you are, and yons the stair; climb up, if you can, but hold on fast. Ill warrant you find the stair easier at home than by such a way; t was neer meant for lassies feet to travel; and off he splashed through the water. So she clomb and she clomb and she clomb, but neer a step higher did she get: the light was before her and around her, and the water behind her, and the more she struggled the more she was forced down into the dark and the cold, and the more she clomb the deeper she fell. But she clomb and she clomb, till she got dizzy in the light and shivered with the cold, and dazed with the fear; but still she clomb, till at last, quite dazed and silly-like, she let clean go, and sank downdowndown. And bang she came on to the hard boards, and found herself sitting, weeping and wailing, by the bedside at home all alone. ----- The story is written by Roger Federer & Serina Williams You can connect with the author at [rfederer@tennis.com] and [swilliams@tennis.com] Admin contact number: 1-888-111-2222