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

Luis Bach
Luis Bach
1,145 Points

File "", line 7, in EOFError: EOF when reading a line

Can someone explain to me why am I getting this type of error on the compiler in the coding quiz after the video? I used other IDE and my code there seems working but here in the compiler in coding quiz keeps appearing.

def square(number): return number * number

numberOfUser = int(input("Enter a number: ")) result = square(numberOfUser) print(result)

this is the code that I already build based on the instruction given by the challenge. Thanks for help>

2 Answers

Steven Parker
Steven Parker
217,455 Points

Be careful about testing a challenge in an external IDE. That might help to identify bad code, but it won't help to spot good code that isn't doing what was asked for.

You didn't link to the challenge, but I'm pretty sure that the challenge doesn't ask you to input anything, which would explain that error. If I recall correctly, the challenge asks you to call the function with a particular argument and store the result in a variable, so you also wouldn't print anything.

For future questions, you might want to take a look at these videos about Posting a Question, and using Markdown formatting to preserve the code's appearance.

Luis Bach
Luis Bach
1,145 Points

Oh okay. Thank you. I already get it.