Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in python Question 5. (25 points). Write a program that will do the following string formatting tasks: 5.1 Ask the user to enter two

Write in python image text in transcribed
Question 5. (25 points). Write a program that will do the following string formatting tasks: 5.1 Ask the user to enter two sentences 5.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', 'T 'alive?", 'This', 'is', 'my', first', 'python', 'program'] or ['Alas, '', 'Am', 'I''alive, ?", This', 'is', 'my', 'first', python', program'] 5.3 Compare the two sentences. Print out a list of words that occur in both sentences 5.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.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

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions