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

6. 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
first_initial. lastname
where
first_initial and lastname are both capitalized
there is exactly one period and space following the first_initial
For example, given s =gandhi, mahatma
the output will be
M. Gandhi
Hint 1: use the following string methods .capitalize() and .find()
Hint 2: 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!