Use title case for a simpler solution

use this instead

def clean_name(name):
    return name.title()
9 Likes