SlideShare a Scribd company logo
Please do both parts in Python and print the output. Thank you.
Problem 3. You are given the following text. In [ ]: M text = "It was dark, like the bottom of a
well. There was a pattern of skulls and bones around I the frame, for the sake of appearances;
Death could not look himself in the skull in a mirror I with cherubs and roses around it. The
Death of Rats climbed the frame in a scrabble of claws and looked at Death expectantly from the
top. Quoth fluttered over and pecked briefly at his own reflection, on the basis that anything was
worth a try. Show me, said Death, show me my thoughts. A chessboard appeared, but it was
triangular, and so big that only the nearest point could be seen. Right on this point was the world
- turtle, elephants, the little orbiting sun and all. It was the I Discworld, which existed only just
this side of total improbability and, therefore, in border country. I In border country the border
gets crossed, and sometimes things creep into the universe that have I rather more on their mind
than a better life for their children and a wonderful future in the fruit picking and domestic
service industries. On every other black or white triangle of the chessboard, all the way to
infinity, was a small grey shape, rather like an empty hooded robe." You are also given a string
that contains all symbols of English alphabet. In [3]: M alphabet =
"abcdefghijklmnopqrstuvwxyz" Part 1. Write some code that generates the list unique_words,
containing all and only the unique lowercase words from text. You should see the following
output (the order can differl): ['a', 'infinity', 'reflection', 'with', 'like', 'big', 'briefly', 'into',
'children', 'which', 'fruit', 'picking', 'ther e', 'try', 'little', 'around', 'appearances', 'appeared', 'all',
'crossed', 'basis', 'improbability', 'their', 'discworl d', 'black', 'to', 'death', 'future', 'only', 'my', 'robe',
'things', 'for', 'it', 'existed', 'said', 'sake', 'sometime s', 'right', 'way', 'that', 'country', 'chessboard',
'quoth', 'well', 'domestic', 'skull', 'wonderful', 'hooded', 'or', 'empty', 'bottom', 'mirror', 'himself',
'rather', 'over', 'every', 'triangle', 'roses', 'border', 'orbiting', 'Was', 'fr om', 'show', 'be', 'pecked',
'bones', 'just', 'universe', 'me', 'triangular', 'gets', 'worth', 'have', 'climbed', 'servi ce', 'fluttered',
'top', 'but', 'grey', 'claws', 'at', 'rats', 'creep', 'own', 'pattern', 'point', 'white', 'than', 'dar k', 'therefore',
'frame', 'this', 'not', 'the', 'could', 'mind', 'turtle', 'scrabble', 'better', 'industries', 'looked', 'an',
'cherubs', 'life', 'anything', 'more', 'small', 'and', 'of', 'his', 'on', 'sku1ls', 'elephants', 'in', 'thoughts',
'seen', 'nearest', 'expectantly', 'other', 'side', 'shape', 'total', 'so', 'world', 'look', 'sun'] In [ ]: M Part
2. Write a program which generates the list bigrams, collect all attested bigrams in Ignore words
that are shorter than 2 characters. Make sure that the list bigrams does not contain duplicates.
Hint. You can use the code to extract bigrams you wrote above. Then, you need to have that code
iterate over each word in the list and add a check for duplicates! In [ ]: M

More Related Content

More from AustinaGRPaigey

PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docxPLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
AustinaGRPaigey
 
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docxPlease Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
AustinaGRPaigey
 
Please help with these questions Arterial Dissection (tear)- may be.docx
Please help with these  questions  Arterial Dissection (tear)- may be.docxPlease help with these  questions  Arterial Dissection (tear)- may be.docx
Please help with these questions Arterial Dissection (tear)- may be.docx
AustinaGRPaigey
 
Please help with this question On June 13- the board of directors of S.docx
Please help with this question On June 13- the board of directors of S.docxPlease help with this question On June 13- the board of directors of S.docx
Please help with this question On June 13- the board of directors of S.docx
AustinaGRPaigey
 
Please help me create a jME 3D scene uses a root node- multiple child.docx
Please help me create a jME 3D scene uses a root node- multiple child.docxPlease help me create a jME 3D scene uses a root node- multiple child.docx
Please help me create a jME 3D scene uses a root node- multiple child.docx
AustinaGRPaigey
 
please help What is the name of the Standard Lead configuration used.docx
please help  What is the name of the Standard Lead configuration used.docxplease help  What is the name of the Standard Lead configuration used.docx
please help What is the name of the Standard Lead configuration used.docx
AustinaGRPaigey
 
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
please answer both! Q2- The graph below shows one 12-hour spring tide.docxplease answer both! Q2- The graph below shows one 12-hour spring tide.docx
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
AustinaGRPaigey
 
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
please explain as well 2- Let X1 and X2 be random variables (not neces.docxplease explain as well 2- Let X1 and X2 be random variables (not neces.docx
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
AustinaGRPaigey
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
AustinaGRPaigey
 
Please check the accuracy of these questions- Loss of function alleles.docx
Please check the accuracy of these questions- Loss of function alleles.docxPlease check the accuracy of these questions- Loss of function alleles.docx
Please check the accuracy of these questions- Loss of function alleles.docx
AustinaGRPaigey
 
Please assist me with a drawing of the following- Draw a side-by-side.docx
Please assist me with a drawing of the following-  Draw a side-by-side.docxPlease assist me with a drawing of the following-  Draw a side-by-side.docx
Please assist me with a drawing of the following- Draw a side-by-side.docx
AustinaGRPaigey
 
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docxPlease assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
AustinaGRPaigey
 
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docxPlease answer the following in 1-2 paragraphs- 1- Why are some countri.docx
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
AustinaGRPaigey
 
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
Please answer the blank spaces   Ine Retina The retina has 2 classes o.docxPlease answer the blank spaces   Ine Retina The retina has 2 classes o.docx
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
AustinaGRPaigey
 
please answer all questions to the activites- The study of genetics an.docx
please answer all questions to the activites- The study of genetics an.docxplease answer all questions to the activites- The study of genetics an.docx
please answer all questions to the activites- The study of genetics an.docx
AustinaGRPaigey
 
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docxPlease add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
AustinaGRPaigey
 
PICTURE INCLUDED What is the probability of the following- (a) An eve.docx
PICTURE INCLUDED  What is the probability of the following- (a) An eve.docxPICTURE INCLUDED  What is the probability of the following- (a) An eve.docx
PICTURE INCLUDED What is the probability of the following- (a) An eve.docx
AustinaGRPaigey
 
Planned brand-company messages should- A- Create brand awareness B- Ch.docx
Planned brand-company messages should- A- Create brand awareness B- Ch.docxPlanned brand-company messages should- A- Create brand awareness B- Ch.docx
Planned brand-company messages should- A- Create brand awareness B- Ch.docx
AustinaGRPaigey
 
PHP-23(H).docx
PHP-23(H).docxPHP-23(H).docx
PHP-23(H).docx
AustinaGRPaigey
 
Peter is a design engineer at a mobile device manufacturing company- H.docx
Peter is a design engineer at a mobile device manufacturing company- H.docxPeter is a design engineer at a mobile device manufacturing company- H.docx
Peter is a design engineer at a mobile device manufacturing company- H.docx
AustinaGRPaigey
 

More from AustinaGRPaigey (20)

PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docxPLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
PLEASE HELP!! Which are affiliate of audit client Port Co A and which.docx
 
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docxPlease Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
Please Help!!! Stave Prinen and Chelsy Parnard formed a partaneship- d.docx
 
Please help with these questions Arterial Dissection (tear)- may be.docx
Please help with these  questions  Arterial Dissection (tear)- may be.docxPlease help with these  questions  Arterial Dissection (tear)- may be.docx
Please help with these questions Arterial Dissection (tear)- may be.docx
 
Please help with this question On June 13- the board of directors of S.docx
Please help with this question On June 13- the board of directors of S.docxPlease help with this question On June 13- the board of directors of S.docx
Please help with this question On June 13- the board of directors of S.docx
 
Please help me create a jME 3D scene uses a root node- multiple child.docx
Please help me create a jME 3D scene uses a root node- multiple child.docxPlease help me create a jME 3D scene uses a root node- multiple child.docx
Please help me create a jME 3D scene uses a root node- multiple child.docx
 
please help What is the name of the Standard Lead configuration used.docx
please help  What is the name of the Standard Lead configuration used.docxplease help  What is the name of the Standard Lead configuration used.docx
please help What is the name of the Standard Lead configuration used.docx
 
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
please answer both! Q2- The graph below shows one 12-hour spring tide.docxplease answer both! Q2- The graph below shows one 12-hour spring tide.docx
please answer both! Q2- The graph below shows one 12-hour spring tide.docx
 
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
please explain as well 2- Let X1 and X2 be random variables (not neces.docxplease explain as well 2- Let X1 and X2 be random variables (not neces.docx
please explain as well 2- Let X1 and X2 be random variables (not neces.docx
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
 
Please check the accuracy of these questions- Loss of function alleles.docx
Please check the accuracy of these questions- Loss of function alleles.docxPlease check the accuracy of these questions- Loss of function alleles.docx
Please check the accuracy of these questions- Loss of function alleles.docx
 
Please assist me with a drawing of the following- Draw a side-by-side.docx
Please assist me with a drawing of the following-  Draw a side-by-side.docxPlease assist me with a drawing of the following-  Draw a side-by-side.docx
Please assist me with a drawing of the following- Draw a side-by-side.docx
 
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docxPlease assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
Please assist with 5-10- This planet is -5544 AU from the sun- 5- Comp.docx
 
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docxPlease answer the following in 1-2 paragraphs- 1- Why are some countri.docx
Please answer the following in 1-2 paragraphs- 1- Why are some countri.docx
 
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
Please answer the blank spaces   Ine Retina The retina has 2 classes o.docxPlease answer the blank spaces   Ine Retina The retina has 2 classes o.docx
Please answer the blank spaces Ine Retina The retina has 2 classes o.docx
 
please answer all questions to the activites- The study of genetics an.docx
please answer all questions to the activites- The study of genetics an.docxplease answer all questions to the activites- The study of genetics an.docx
please answer all questions to the activites- The study of genetics an.docx
 
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docxPlease add in depth explanation (HARD) Suppose you repeated the Bernar.docx
Please add in depth explanation (HARD) Suppose you repeated the Bernar.docx
 
PICTURE INCLUDED What is the probability of the following- (a) An eve.docx
PICTURE INCLUDED  What is the probability of the following- (a) An eve.docxPICTURE INCLUDED  What is the probability of the following- (a) An eve.docx
PICTURE INCLUDED What is the probability of the following- (a) An eve.docx
 
Planned brand-company messages should- A- Create brand awareness B- Ch.docx
Planned brand-company messages should- A- Create brand awareness B- Ch.docxPlanned brand-company messages should- A- Create brand awareness B- Ch.docx
Planned brand-company messages should- A- Create brand awareness B- Ch.docx
 
PHP-23(H).docx
PHP-23(H).docxPHP-23(H).docx
PHP-23(H).docx
 
Peter is a design engineer at a mobile device manufacturing company- H.docx
Peter is a design engineer at a mobile device manufacturing company- H.docxPeter is a design engineer at a mobile device manufacturing company- H.docx
Peter is a design engineer at a mobile device manufacturing company- H.docx
 

Recently uploaded

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 

Recently uploaded (20)

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 

Please do both parts in Python and print the output- Thank you- Proble.docx

  • 1. Please do both parts in Python and print the output. Thank you. Problem 3. You are given the following text. In [ ]: M text = "It was dark, like the bottom of a well. There was a pattern of skulls and bones around I the frame, for the sake of appearances; Death could not look himself in the skull in a mirror I with cherubs and roses around it. The Death of Rats climbed the frame in a scrabble of claws and looked at Death expectantly from the top. Quoth fluttered over and pecked briefly at his own reflection, on the basis that anything was worth a try. Show me, said Death, show me my thoughts. A chessboard appeared, but it was triangular, and so big that only the nearest point could be seen. Right on this point was the world - turtle, elephants, the little orbiting sun and all. It was the I Discworld, which existed only just this side of total improbability and, therefore, in border country. I In border country the border gets crossed, and sometimes things creep into the universe that have I rather more on their mind than a better life for their children and a wonderful future in the fruit picking and domestic service industries. On every other black or white triangle of the chessboard, all the way to infinity, was a small grey shape, rather like an empty hooded robe." You are also given a string that contains all symbols of English alphabet. In [3]: M alphabet = "abcdefghijklmnopqrstuvwxyz" Part 1. Write some code that generates the list unique_words, containing all and only the unique lowercase words from text. You should see the following output (the order can differl): ['a', 'infinity', 'reflection', 'with', 'like', 'big', 'briefly', 'into', 'children', 'which', 'fruit', 'picking', 'ther e', 'try', 'little', 'around', 'appearances', 'appeared', 'all', 'crossed', 'basis', 'improbability', 'their', 'discworl d', 'black', 'to', 'death', 'future', 'only', 'my', 'robe', 'things', 'for', 'it', 'existed', 'said', 'sake', 'sometime s', 'right', 'way', 'that', 'country', 'chessboard', 'quoth', 'well', 'domestic', 'skull', 'wonderful', 'hooded', 'or', 'empty', 'bottom', 'mirror', 'himself', 'rather', 'over', 'every', 'triangle', 'roses', 'border', 'orbiting', 'Was', 'fr om', 'show', 'be', 'pecked', 'bones', 'just', 'universe', 'me', 'triangular', 'gets', 'worth', 'have', 'climbed', 'servi ce', 'fluttered', 'top', 'but', 'grey', 'claws', 'at', 'rats', 'creep', 'own', 'pattern', 'point', 'white', 'than', 'dar k', 'therefore', 'frame', 'this', 'not', 'the', 'could', 'mind', 'turtle', 'scrabble', 'better', 'industries', 'looked', 'an', 'cherubs', 'life', 'anything', 'more', 'small', 'and', 'of', 'his', 'on', 'sku1ls', 'elephants', 'in', 'thoughts', 'seen', 'nearest', 'expectantly', 'other', 'side', 'shape', 'total', 'so', 'world', 'look', 'sun'] In [ ]: M Part 2. Write a program which generates the list bigrams, collect all attested bigrams in Ignore words that are shorter than 2 characters. Make sure that the list bigrams does not contain duplicates. Hint. You can use the code to extract bigrams you wrote above. Then, you need to have that code iterate over each word in the list and add a check for duplicates! In [ ]: M