← Back to challenges

Capital Split

PythonHardstringsloops

Instructions

Create a function which adds spaces before every capital in a word. Uncapitalize the whole string afterwards.

Examples

cap_space("helloWorld") ➞ "hello world"

cap_space("iLoveMyTeapot") ➞ "i love my teapot"

cap_space("stayIndoors") ➞ "stay indoors"

Notes

The first letter will stay uncapitalized.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Simple Numbers