Question: Write methods that accomplish each of the following tasks: a) Check whether the string is terminated by a full stop, and if not, add a
Write methods that accomplish each of the following tasks:
a) Check whether the string is terminated by a full stop, and if not, add a full stop.
b) Check whether the string starts with a capital letter, and if not, capitalize the first letter.
c) Use the methods developed in parts (a) and (b) and to write a method beautifyString that receives a string from the user, and then calls the methods in (a) and (b) to make sure that the string is properly formatted, in other words, the string has a full stop at the end, and a capitalized first letter. Make sure you output the string after it has been beautified!
Step by Step Solution
3.41 Rating (164 Votes )
There are 3 Steps involved in it
Here is the answer in Python 1 Function to check if a string is terminat... View full answer
Get step-by-step solutions from verified subject matter experts
