Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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