Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed in python3, output has to look exactly like this:
image text in transcribed
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

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

Step: 3

blur-text-image

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions