In: Computer Science
a, an, as, at, by, for, in, is, it, of, that, this, to, was, will, the
These are typical words that are considered to have low semantic value.
Process each paragraph provided below individually. Your end result for each paragraph should be a string or list containing the processed paragraph with the common words and punctuation removed. It is not required to put the text samples into a file (you can simply copy and paste into a string variable inside your Python script).
For the text samples to process, use the following (taken from the official Python tutorial):
If you do much work on computers, eventually you find that there’s some task you’d like to automate. For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you’d like to write a small custom database, or a specialized GUI application, or a simple game.
If you’re a professional software developer, you may have to work with several C/C++/Java libraries but find the usual write/compile/test/re-compile cycle is too slow. Perhaps you’re writing a test suite for such a library and find writing the testing code a tedious task. Or maybe you’ve written a program that could use an extension language, and you don’t want to design and implement a whole new language for your application.
Code
str=input()
#punctuations list
p = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
#list of words to be removed
l= [' a ',' an ',' as ',' at ',' by ',' for ',' in ', ' is ',' it ',' of ',' that ',' this ',' to ',' was ',' will ',' the ']
r=""
for i in str:
if i not in l and i not in p:
r+=i
print(r)
Terminal Work
.