Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 2.35 KB

File metadata and controls

32 lines (25 loc) · 2.35 KB

Project Gutenberg Explorer

Assignment Description:

In this assignment, you will embark on an adventure to explore the vast collection of literary works available at Project Gutenberg. You will learn how to open and read contents from external files in Python while uncovering interesting facts about famous books and authors. Get ready for a journey through words!

Instructions:

  1. Familiarize yourself with Project Gutenberg, a digital library that offers over 60,000 free eBooks.

  2. Choose any book of your choice from Project Gutenberg. Consider selecting a classic novel or a renowned piece of literature.

  3. Write a Python program that accomplishes the following tasks:

    • Open the chosen book's text file (available in plain text format on Project Gutenberg).
    • Read and display the book's title, author, and publication date.
    • Count the total number of paragraphs in the book and display the result.
    • Prompt the user to enter a word or phrase.
    • Search the book for occurrences of the entered word or phrase.
    • Display the number of times the word or phrase appears in the book.
  4. Test your program with different books and search terms to ensure its functionality and correctness.

  5. Document your code using comments to explain its logic and functionality clearly.

  6. Add appropriate error handling to account for scenarios such as file not found or errors during file reading.

Note: Make sure to download the text file of the chosen book from Project Gutenberg and save it in the same directory as your Python program file.

Bonus Challenges (Optional):

  1. Implement a feature to calculate the average word length in the book.
  2. Extend the search functionality to allow searching for multiple words or phrases and display the occurrences of each.
  3. Create a graphical user interface (GUI) for your program, allowing users to select a book and search for words using buttons and text fields.

Submission Guidelines:

  1. Submit your Python program file (e.g., project_gutenberg_explorer.py) along with the chosen book's text file.
  2. Include a document (e.g., README.txt or README.md) explaining how to run your program and any additional features you implemented.

Remember to have fun exploring the treasures of Project Gutenberg while mastering the art of opening and reading contents from external files in Python!