Fill: String Join
Fill in the Blank Medium
Question
Fill in the blank to join the words with commas.
Code
words = ["apple", "banana", "cherry"]
result = ", ".___(words)
Hint
The method that concatenates strings with a separator is...
Explanation
join() concatenates the elements of an iterable with the string as separator. ', '.join(['apple', 'banana', 'cherry']) = 'apple, banana, cherry'. The separator calls join on the list.
Related Resources
Related Lessons
- Strings
String join.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.