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.

Python Python Basics Functions and Looping Create a Function

Emmanuel Mejia
Emmanuel Mejia
4,864 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,169 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,862 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).