Question
Create a Python program that asks the user to input a string and then prints out that string in Title function (string.title()). That is, the
Create a Python program that asks the user to input a string and then prints out that string in Title function (string.title()). That is, the first letter of each word is uppercase and the remainder of the word is lowercase. If the entire word is two letters long, the entire word is lower case. The three letter words and, the, and not are all lowercase while all other three letter words are capitalized. The first word in the string is capitalized, no matter how long it is. So if the user enters the string the following string: the dog and the mouse fought over the piece of bread, and it was not a pleasant sight. Output : The Dog and the Mouse Fought Over the Piece of Bread, and it Was not a Pleasant Sight. Note* If sentence starts with and, the , or not it the word should still be capitalized.
2 define sentence() 4 """ exceptions"" 5 sentence = (input ("Enter a sentence: "))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started