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

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
231,264 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.

Oh okay. Thank you. I already get it.