logo CodeStepByStep logo

last_first

Language/Type: Python return string

Write a function named last_first that accepts a string as its parameter representing a person's first and last name. The function should return the person's last name followed by the first initial and a period. For example, the call last_first("Marla Singer") should return "Singer, M." . You may assume that the string passed consists of exactly two words separated by a single space.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.