Functions · routine
Repeat with a default
Write repeat(word, times=2, sep=" ") returning word repeated times times, joined by sep. repeat("hi") is "hi hi"; repeat("ab", 3, "-") is "ab-ab-ab".
- right answers
- arguments left as they should be
Run adds print(repeat("hi")) after your code, to try it.
Stuck on the idea rather than the code? The Defaults and guard clauses lesson walks through it.