## 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.

# Can't get code to run on test, but runs everywhere else...please help? Maybe I am not understanding problem?

```def add_list(numbers):
num_list = numbers
total = sum(num_list)
print(total)

def summarize(numbers):
num_list = numbers
liststring = str(num_list)
total = sum(num_list)
totalstring = str(total)
print("The sum of " + liststring + " is " + totalstring + ".")

summarize([1, 2, 3])
```

Thank you! :)

In the test, they want you to return answers, not print them. Remember, printing something sends words to your screen, whereas using return is the "answer" from the function. Change both of your last lines to return and that should fix your issue. There is also a little bit of redundancy in your code (unnecessary lines) that you could remove if you want. Here is an example of what I did:

```def add_list(items):
total = 0
for item in items:
total += item

def summarize(lists):
newList = str(lists)
return("The sum of {} is {}.".format(newList, total))
```

Your `summarize` method is probably a bit more pythonic than mine. It's been a while since I've used Python.

Thank you, I sincerely appreciate the help :)

Cool...I had to look that one up...LOL you guys are great...appreciate the support.

You're over thinking it. For the first one they want you to use a for loop. For the second one all you need is a return value. Here's what I did:

```def add_list(l):
output = 0
for li in l:
output += li
return output

def summarize(l):
return "The sum of " + str(l) + " is " + str(add_list(l)) + "."
```

Thank you! :)