Learn
Now let’s try working with strings!
for item in list: print item for i in range(len(list)): print list[i]
The example above is just a reminder of the two methods for iterating over a list.
Instructions
1.
Create a function that concatenates strings.
- Define a function called
join_strings
accepts an argument calledwords
. It will be a list. - Inside the function, create a variable called
result
and set it to""
, an empty string. - Iterate through the
words
list and concatenate each word toresult
. - Finally,
return
theresult
.
Don’t add spaces between the joined strings!
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.