← Back to challenges

Emphasise the Words

PythonHardstringsloopsregex

Instructions

The challenge is to recreate the functionality of the title() method into a function called emphasise(). The title() method capitalises the first letter of every word and lowercases all of the other letters in the word.

Examples

emphasise("hello world") ➞ "Hello World"

emphasise("GOOD MORNING") ➞ "Good Morning"

emphasise("99 red balloons!") ➞ "99 Red Balloons!"

Notes

  • You won't run into any issues when dealing with numbers in strings.
  • Please don't use the title() method directly :(
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Last Digit Ultimate