Text processing · 9 / 14 Exercise Easy

Normalize names

Objective

Create a Python program that cleans up a carelessly written name.

Instructions

  • Read a full name, which may have mixed upper and lower case and several spaces between the words.
  • Leave each word with the first letter in upper case and the rest in lower case (capitalize()).
  • Show the name with the words separated by a single space.
Input
ana    MARIA  garcia
Output
Ana Maria Garcia

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise