← Back to challenges

WordCharWord

PythonMediumstringsformatting

Instructions

Create a function that will put the first argument, a character, between every word in the second argument, a string.

Examples

add("R", "python is fun") ➞ "pythonRisRfun"

add("#", "hello world!") ➞ "hello#world!"

add("#", " ") ➞ "#"

Notes

Make sure there are no spaces between words when returning the function.

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