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 trial

Python Python Basics (Retired) Putting the "Fun" Back in "Function" Functions

Elliot Strickland
Elliot Strickland
5,627 Points

Right answer, wrong way of coding it?

def summarize(alist): return('The sum of {} is {}'.format(alist, add_list(alist)))

I get this message when 'checking work' and cannot move on...

Bummer! summarize returned the wrong output. Got 'The sum of [1, 2, 3] is 6' instead of 'The sum of [1, 2, 3] is 6.'.

3 Answers

Elliot Strickland You are almost right. But you missed a little information. In the two challenge, question was to use string version of "alist" variable.

In your code it is an list. But challenge expects string version.

Please check my code.

def summarize(pass_list):
    return "The sum of {} is {}.".format(str(pass_list),add_list(pass_list))

I hope it helps

Gergő Bogdán
Gergő Bogdán
6,664 Points

As I can see you are missing a . from the end of the sentence. The sum of [1,2,3] is 6.