Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Abby Schoeller
Courses Plus Student 6,187 PointsJoining two lists
I think I am stuck at the bottom, trying to concatenate and print out the joined lists.
words = []
numbers = []
def combiner(*args):
for arg in args:
if isinstance(arg, str):
words.append(arg)
if isinstance(arg, float):
numbers.append(arg)
full_list = words + numbers.sum()
print(full_list.join())
1 Answer

Chris Freeman
Treehouse Moderator 68,082 PointsYou are on the right path. There are a few items to fix up.
- remove the * from the
args
parameter. The function input will be a single list. By using the *, the function packets the entire list into the first element of the tuple*args
:(["apple", 5, "dog", 8.2], )
. This means thefor
loop will be seen alist
instance. It might be better to change the param name toitems
and usefor item in items
- the empty list initialization should be inside the function definition
- remember to check for integers too:
isinstance(arg, int)
- the list
numbers
does not have asum
method. Usesum(numbers)
instead - to join the
words
list into a single string, use"".join(words)
- be sure to add a string version of the sum to the end of the word string
-
return the final value. Using
print
is not seen by the challenge checker
Post back if you have more questions. Good Luck!!