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 (2015) Logic in Python Try and Except

My code worked earlier today and in python, but I now get an EOF error

What is wrong with this coding for the first trial.py exercise? def add (first, second): first=int(input("First number? ")) second=int(input("Second number? ")) return first + second

trial.py
def add (first, second):
    first=int(input("First number? "))
    second=int(input("Second number? "))
    return first + second

2 Answers

This question is misleading because it states that you have to solve the ValueLabel exception before the numbers are converted into floating point numbers. The correct answer does not correspond to the statement of the problem.

What happens in automated testing of your code is... your code is ran and a file with sample input is passed along. When the result matches the pre-calculated result, your code is accepted.

here you dont have to take the input from user. Just write the function and script will take care of it from its end.

def add (first, second):
    return first + second

Thanks Krishna, I had already gotten to the third problem earlier in the day, so I guess I jumped ahead of the game when I had to go back to the first question. In any case, I truly appreciate your input, and can now go on with the tutorial! Yeah!!! Bill