Question: in python3, output has to look exactly like this: it must give an error message if file is invalid You shall create a Python script

 in python3, output has to look exactly like this: it must in python3, output has to look exactly like this:
give an error message if file is invalid You shall create a
it must give an error message if file is invalid

You shall create a Python script that reads in a single sentence from the user. You may either accept this input through the keyboard or use a text file as input. That is, the program may pause and wait for the user to type a sentence or it may open an existing file with the sentence inside. The choice is left to the student (I prefer reading files when developing because I don't need to keep typing in text). The script shall then parse the input string using a regular expression (import re) and detect the FANBOYS present. These words may all appear naturally in a sentence by themselves, so to count as a FANBOYS, a comma must immediately precede the conjunction. After locating each of the FANBOYS, the program shall display the separate thoughts these words link together and display the result to the screen. It shall number each thought sequentially. Using the previous example as the input string, the program would then output: 1: I ate a brownie for breakfast 2: I ate a cookie 3: I am in quarantine

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!