SlideShare a Scribd company logo
1) Write a Python function that determines the number of unique words in a text file, for
example, "The Complete Works of William Shakespeare" and counts how many times each word
occurs. It should accept the path to a text file as the input argument and then print the total
number of words in the file, the top 19 most frequently used words, and how many times each
occurs.

More Related Content

More from leelaelec

More from leelaelec (20)

1) The security of connected devices is paramount to the success of th.pdf
1) The security of connected devices is paramount to the success of th.pdf1) The security of connected devices is paramount to the success of th.pdf
1) The security of connected devices is paramount to the success of th.pdf
 
1) The monogastric animal's stomach is divided into four major areas t.pdf
1) The monogastric animal's stomach is divided into four major areas t.pdf1) The monogastric animal's stomach is divided into four major areas t.pdf
1) The monogastric animal's stomach is divided into four major areas t.pdf
 
1) Set the text color to navy- for all elements- 2) Set the text color.pdf
1) Set the text color to navy- for all elements- 2) Set the text color.pdf1) Set the text color to navy- for all elements- 2) Set the text color.pdf
1) Set the text color to navy- for all elements- 2) Set the text color.pdf
 
1) Platt Corporation paid $87-500 for a 70- interest in Suve Corporati.pdf
1) Platt Corporation paid $87-500 for a 70- interest in Suve Corporati.pdf1) Platt Corporation paid $87-500 for a 70- interest in Suve Corporati.pdf
1) Platt Corporation paid $87-500 for a 70- interest in Suve Corporati.pdf
 
1) Solve the generalized eigenvalue problem- Reference from 114- - c.pdf
1) Solve the generalized eigenvalue problem-   Reference from 114- - c.pdf1) Solve the generalized eigenvalue problem-   Reference from 114- - c.pdf
1) Solve the generalized eigenvalue problem- Reference from 114- - c.pdf
 
1) Please share an experience that you have working with individuals f.pdf
1) Please share an experience that you have working with individuals f.pdf1) Please share an experience that you have working with individuals f.pdf
1) Please share an experience that you have working with individuals f.pdf
 
1) How do fossils help geologists determine ages of rocks- 2) Why is r.pdf
1) How do fossils help geologists determine ages of rocks- 2) Why is r.pdf1) How do fossils help geologists determine ages of rocks- 2) Why is r.pdf
1) How do fossils help geologists determine ages of rocks- 2) Why is r.pdf
 
1) Income from an employment may be the only source for some individua.pdf
1) Income from an employment may be the only source for some individua.pdf1) Income from an employment may be the only source for some individua.pdf
1) Income from an employment may be the only source for some individua.pdf
 
1) Grant Hill discusses the challenge teams have to get younger fans o.pdf
1) Grant Hill discusses the challenge teams have to get younger fans o.pdf1) Grant Hill discusses the challenge teams have to get younger fans o.pdf
1) Grant Hill discusses the challenge teams have to get younger fans o.pdf
 
1) For the purpose of Cost-Saving- your organization is planning to mo.pdf
1) For the purpose of Cost-Saving- your organization is planning to mo.pdf1) For the purpose of Cost-Saving- your organization is planning to mo.pdf
1) For the purpose of Cost-Saving- your organization is planning to mo.pdf
 
1 Explore the extracted files and search for interesting information-.pdf
1 Explore the extracted files and search for interesting information-.pdf1 Explore the extracted files and search for interesting information-.pdf
1 Explore the extracted files and search for interesting information-.pdf
 
1) Explain the different types of firewalls- 2) How is a firewall diff.pdf
1) Explain the different types of firewalls- 2) How is a firewall diff.pdf1) Explain the different types of firewalls- 2) How is a firewall diff.pdf
1) Explain the different types of firewalls- 2) How is a firewall diff.pdf
 
1) General transcription factors function to activate gene expression.pdf
1) General transcription factors function to activate gene expression.pdf1) General transcription factors function to activate gene expression.pdf
1) General transcription factors function to activate gene expression.pdf
 
1) describe what a function is and how it can be used- 2) describe th.pdf
1) describe what a function is and how it can be used-  2) describe th.pdf1) describe what a function is and how it can be used-  2) describe th.pdf
1) describe what a function is and how it can be used- 2) describe th.pdf
 
1) Define the term Market Potential- and why is it an important to a f.pdf
1) Define the term Market Potential- and why is it an important to a f.pdf1) Define the term Market Potential- and why is it an important to a f.pdf
1) Define the term Market Potential- and why is it an important to a f.pdf
 
1) Explain the impact technology has on control- 2) Do you believe tha.pdf
1) Explain the impact technology has on control- 2) Do you believe tha.pdf1) Explain the impact technology has on control- 2) Do you believe tha.pdf
1) Explain the impact technology has on control- 2) Do you believe tha.pdf
 
1) Discuss various theories of financing a public transport infrastruc.pdf
1) Discuss various theories of financing a public transport infrastruc.pdf1) Discuss various theories of financing a public transport infrastruc.pdf
1) Discuss various theories of financing a public transport infrastruc.pdf
 
1 The United States is considered a net debtor nation- a net creditor.pdf
1 The United States is considered a net debtor nation- a net creditor.pdf1 The United States is considered a net debtor nation- a net creditor.pdf
1 The United States is considered a net debtor nation- a net creditor.pdf
 
1) Compare and contrast the leadership traits discussed in the TedTalk.pdf
1) Compare and contrast the leadership traits discussed in the TedTalk.pdf1) Compare and contrast the leadership traits discussed in the TedTalk.pdf
1) Compare and contrast the leadership traits discussed in the TedTalk.pdf
 
1) Create table RoomReservation for hotel management system a- Assume.pdf
1) Create table RoomReservation for hotel management system a- Assume.pdf1) Create table RoomReservation for hotel management system a- Assume.pdf
1) Create table RoomReservation for hotel management system a- Assume.pdf
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 

1) Write a Python function that determines the number of unique words.pdf

  • 1. 1) Write a Python function that determines the number of unique words in a text file, for example, "The Complete Works of William Shakespeare" and counts how many times each word occurs. It should accept the path to a text file as the input argument and then print the total number of words in the file, the top 19 most frequently used words, and how many times each occurs.