Question: Write a function called cap 2 ( ) that takes a word and 'fixes' it so that only the first and last - tolast letters
Write a function called cap that takes a word and 'fixes' it so that only the first and lasttolast letters are capitalized. This function takes a string, and returns a string. Signature: def capword: # your code here return Assumptions: Don't make any changes for empty strings; or strings with one letter. Examples: capweekend 'WeekeNd' capCoffee 'CoffEe' capGradeScope 'GradescoPe'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
