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 Functions and Looping Create a Function

Emmanuel Mejia
Emmanuel Mejia
5,884 Points

Keep getting EOF. Do not know what is the problem this time.

Hello, I keep getting an EOF error when trying to run this. I run it in my idle and comand prompt and it works perfectly but when i try submitting this, it is not working.

def square(number):
    return number**2

number = int(input("Which number "))

result = square(number)


2 Answers

John Lack-Wilson
John Lack-Wilson
8,181 Points

You do not need to print the result or get the input, the challenge is simply asking you to define the function. If you remove everything except the square function, you will pass the challenge.

Alex Koumparos
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Emmanuel,

I explained why you are getting this error yesterday. If you didn't understand my explanation it would be better for you to describe exactly what you are confused by rather than just repeating the same question (and getting basically the same answer again).