Question: Write a program that will do the following string formatting tasks: (1) Ask the user to enter two sentences. (2) Make each sentence into a

Write a program that will do the following string formatting tasks: (1) Ask the user to enter two sentences. (2) Make each sentence into a list. Each element in the list should correspond to a word in the sentence. For example, if the sentence is "Alas! Am I alive? This is my first python program", the program should print out ['Alas, '!', 'Am', 'I', 'alive, '?', 'This', 'is', 'my', 'first', 'python', 'program']. (3) Compare the two sentences. Print out a list of words that occur in both sentences. (4) Remove any punctuation from the sentence and print it back out. It should remove at least the following characters, but it can remove more: period(.), comma (,), semicolon (;), and colon (:) (5) Count the number of vowels in the sentences. Print out each vowel and the number of times it appears in the sentences, such as: a:2, e:1, i:0, etc

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!