Question: Prompt: TRIPLETS GENERATOR Write a program for reading a text file composed of multiple lines and print all the triplets of adjacent words of the

Prompt: TRIPLETS GENERATOR 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 files doesnt contain genitives (possessive) nor contractions, such as nt or ve. The program must handle possible problems during input/output. TEST FILE: Copy it in some other text editor i.e. sublime text, notepad etc. The words must be equally spaced.

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 Fields Nothing is Real, and nothing to get hung about Strawberry Fields forever

THE OUTPUT SHOULD BE : (IS, IN , MY) (NOT, TOO, BAD) (TOO, BAD , LET) . APPROVED CHEATSHEET: Python Official Documentation. Cheat: READ THE FILE-

>>> print(open(file_name.txt, r).read()) NOTE: No auto-complete or suggestion available.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!