Question: The list names where each element is a string in First Name Last Name sequence. Derive a new list from names where the string is

The listnameswhere each element is a string in "First Name Last Name" sequence. Derive a new list fromnameswhere the string is in "Last Name, First Name" sequence. Use list comprehension to convert the list.

names = ["Isaac Newton", "Albert Einstein", "Niels Bohr", "Marie Curie","Charles Darwin", "Galileo Galilei", "Margaret Mead"]

Output should be:

['Newton, Isaac', 'Einstein, Albert', 'Bohr, Niels', 'Curie, Marie', 'Darwin, Charles', 'Galilei, Galileo', 'Mead, Margaret']

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 Programming Questions!