Question: 6 . String Methods. Given a name in the format lastname, firstname where there is exactly one comma and exactly one space transform the name
String Methods.
Given a name in the format
lastname, firstname
where there is exactly one comma and exactly one space
transform the name into the format
firstinitial. lastname
where
firstinitial and lastname are both capitalized
there is exactly one period and space following the firstinitial
For example, given s gandhi mahatma
the output will be
M Gandhi
Hint : use the following string methods capitalize and find
Hint : do not use the split method. You are not allowed to use advanced data structure such as: Lists and Tuples.
Use the input statement in the skeleton code:
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
