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

# EOFError

Hi, I'm doing a the Challenge Task 1 of Putting the "Fun" Back in "Function".

I made a working script in the shell but when I check the work in treehouse interface I get an EOFError.

Any thoughts on why this is happening?

Rafael Code is:

```number_list = []

def show_intro():
print ("Please enter a list of numbers you want to sum.")
print ("Enter 's' to calculate result.")

def append_list(num):
number_list.append(num)
print ("Added! List has {} items.".format(len(number_list)))

for num in number_list:
sum(num)

def result():
sum = 0
for num in number_list:
sum += int(num)
print ("Sum is {}.".format(sum))

show_intro()

while True:
new_num = input("> ")
if new_num == 's':
result()
break
else:
append_list(new_num)
``` STAFF

Hmm, tested it again today and I get the same error.

Maybe it has something to do with you writing a whole script instead of just the needed functions? Your code definitely doesn't pass the requirements for the task. For example, your `add_list` doesn't add together all of the numbers of a list and return the total. PLUS

Hi Kenneth,

I removed what was in the result function and put it in de add_list so that the latter actually adds together all of the numbers in the list. However, I pasted the script again and get again the EOF error.

Maybe it does have to do with writing a whole script. Any thoughts?

```number_list = []

def show_intro():
print ("Please enter a list of numbers you want to sum.")
print ("Enter 's' to calculate result.")

def append_list(num):
number_list.append(num)
print ("Added! List has {} items.".format(len(number_list)))

sum = 0
for num in number_list:
sum += int(num)
print ("Sum is {}.".format(sum))

show_intro()

while True:
new_num = input("> ")
if new_num == 's': Taking out the `while True:` gives more informative errors.