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

Question on squaring challenge task

Hello, I am getting an end of file error on this line of this code but I don't understand why.

number = int(input("What is your number ?"))

Is there something I'm missing? Thanks

3 Answers

Rick Gleitz
Rick Gleitz
47,876 Points

Hi Paul, It's hard to tell without knowing what course and in which challenge you are in, but if I were to venture a guess, I would have to say that it might have failed because the checker wants you to have a space after the question mark in your string. See if that helps. If not, let me know the course, stage, and challenge step you are on and I'll look further.

Hi Rick, Thanks for responding so quickly. I’ll give it a try. Have a great week. Paul

If anyone else is reading this you should know that I found the answer on a comment elsewhere in this forum.

In addition to the line of code that I have listed I also wrote lines that would print the result. It turns out that Having anything other that JUST what the question asks for causes an error. What was frustration me was that the only guidance I got was the file error and a reference to “”. With only that I didn’t understand that the lines of code that I added after it were the actual problem.

I hope this helps.