Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichal Przybusz
9,925 PointsThe method returns the expected string (concatenated strings + sum of numbers). What needs to be fixed?
What is the right solution to this task? My method seems to return the right string, all strings concatenated and a sum of of numbers?
def combiner(*args):
sum = 0
words = ""
for number in args:
if isinstance(number, (float, int)):
sum = sum + number
elif isinstance(number, str):
words = words + number
final = words + str(sum)
return final
1 Answer
jhon white
20,006 PointsThe challenge said the function takes a (list) not a (tuple), so you need to fix the header of your function.
def combiner(args):
Good luck :)