15Capitalize Every Word

    Easystringslists

    Write capitalize_words(sentence) that makes the first letter of every word upper case and leaves the rest of each word as it is.

    Words are separated by single spaces.

    Examples

    Example 1
    >>> capitalize_words('hello world')
    'Hello World'
    Example 2
    >>> capitalize_words('python is fun')
    'Python Is Fun'

    Run examples checks the 2 examples above. Submit runs all 6 tests, including hidden edge cases, and marks the challenge solved.

    solution.py
    Loading Python…

    Test results show up here

    Write capitalize_words in the editor, then run the examples. Use print() freely: its output is shown for each test.