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 trialLiadan Ryland
458 PointsGetting an EOF error, but shouldn't
I'm getting an EOF error on the treehouse site, but when I run this code on my computer using command prompt, it works.
def square(number):
return (number * number)
number = int(input("What is your favorite number?"))
squared = square(number)
print(squared)
1 Answer
Jennifer Nordell
Treehouse TeacherHi, Liadan Ryland ! I received your request for assistance. It is important when doing these challenges to not do any more than they explicitly ask for. Remember, there is no one over at the other side to put in a number. Rather the code on Treehouse's side is going to run your code and it should execute as expected.
So while code may be functional in your local environment, it does not necessarily mean it will pass the challenge. To advance past step 1 simply erase the last three lines.
Hope this helps!
Liadan Ryland
458 PointsThank you Jennifer, that's helpful to know!
Matthew Mansfield
1,086 PointsMatthew Mansfield
1,086 PointsI've had similar errors with previous code while locally I don't have such issues. I also think you and I are complicating it more than we should.
Simplify your code to just show and it should work.
def square(number):
return (number * number)
result = square(3)