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!
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
Abdul-Rahman Dambazau
216 PointsIf statement error
Script: Points=int(input("How many points does it usually take a team to avoid relegation from the premier league?")) if Points >= 40: print("Correct!")
This is what I get when I run the code:
treehouse:~/workspace$ python if.py
File "if.py", line 2
age = int(input("What is your age? "))
^
IndentationError: unexpected indent
treehouse:~/workspace$

KRIS NIKOLAISEN
54,940 PointsCan you post all of your code and use markdown? See the cheatsheet below. You should have three backticks and the word python ```python
before your code and three backticks after your code. The backtick key is just to the left of the number 1 on the keyboard. It will make it a lot easier to help, especially with indentation errors and with an error on line 2.

Chris Freeman
Treehouse Moderator 68,332 PointsOn an indention error or a invalid stream error, the actual cause is usually the statement before the line reported in the stacktrace message.
1 Answer

Steven Parker
224,874 PointsThe error message refers to a part of the code that is not shown in your sample.
It's apparently on the second line of the file "if.py", and it is indented when Python expects it to not be. Or as Chris suggested, there may be a problem on line 1 that is being misreported.

Abdul-Rahman Dambazau
216 PointsThank you. I figured it out eventually.
Abdul-Rahman Dambazau
216 PointsAbdul-Rahman Dambazau
216 PointsPlease let me know what I need to fix in the code. Thank you.