Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using python please it is an urgent exam in less than 1 hour plz Write a program for reading a text file

image text in transcribed

Write a program using python please it is an urgent exam in less than 1 hour plz

Write a program for reading a text file composed of multiple lines and print all the triplets of adjacent words of the same length Words must be printed in uppercase. Punctuation marks should not be considered part of the words the file does not contain genitives (possessive) nor contractions, such as n't or 've. The program must handle possible problems during input/output. For example, given the file strawberry-short.txt No one I think is in my tree I mean it must be high or low That is you cannot, you know, tune in, but it is all right That is I think it is not too bad... Let me take you down, because I am going to Strawberry Fiels Nothing is real, and nothing to get hung about Strawberry Fields forever The output should be: ('IS', 'IN', 'MY') ("NOT', 'TOO', "BAD') ('100', 'BAD', 'LET') Please note that too and bad appear in two different triplets. While for the complete lyrics (file strawberry.txt), the output should be: ('EASY', 'WITH', 'EYES') ('ALL', 'YOU', SZE') ('IS', 'IN', 'MY') ('NOT', 'TOO', 'BAD') ('TOO', 'BAD', 'LET') ('IT', 'IS', 'ME')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Q4 What is the difference between automation and augmentation?

Answered: 1 week ago

Question

4. Help trainees set challenging mastery or learning goals.

Answered: 1 week ago

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago