Capitalizing First and Last Letters of a String in Python
Python Program to convert first and last letters of a string into uppercase and remaining letters to lowercase.
A string is a sequence of characters of lowercase and uppercase. A user can type lowercase letters instead of typing uppercase letters, for such conditions we need to Capitalize those letters. Suppose a user needs to give input that has first and last letters as capital letters but the user is mistakenly given all letters as lowercase letters then this program works in converting those letters
If a user gives "proGraMminG" as input but the proper input should be "ProgramminG" then we have to convert "p" into "P", "G" into "g", and "M" into "m" to make the input proper.
Project Files
/
Loading...
| .. | ||
| This directory is empty. | ||