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 trialjeffrey chow
1,261 Pointsunexpected string
what does unexpected string mean when its a variable
admitted = None
age = 15
if age > 13: admitted = True
2 Answers
Chris Freeman
Treehouse Moderator 68,454 PointsSorry the feedback message isn't very clear. The issue is the indentation of the if
command. It should start at the beginning of the line. Also,
- the
admitted
assignment should be on a new line indented more than theif
- the check should be if
age
is greater than or equal to 13, not just greater than 13 - remove the
age = 14
assignment. The challenge checker will setage
to various values during testing. Setting the valued explicit interferes with the checker.
Post back if you need more help. Good luck!!
Marcus Sassi
4,394 PointsChris Freeman is correct.
Your code should be like this:
admitted = None
age = 15
if age > 13:
admitted = True