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 trialentrepreneur
458 PointsRaise an Exception Question (Syntax Error)
I keep getting an error which says "IndentationError: unindent does not match any outer indentation level" for line 5.
def suggest(product_idea):
if product_idea < 3:
raise ValueError ("Didn't Work")
return product_idea + "inator"
except ValueError as err:
print("{}".format(err))
2 Answers
KRIS NIKOLAISEN
54,972 PointsIt looks like except
is somewhere before your first indentation level if product_idea < 3:
Outside of this if you are going to use except I believe you need a try clause. And those should come before the return statement. But all of that isn't necessary to complete the challenge. You can remove lines 5 and 6.
Then you just need to make sure you are comparing the length of product_idea to 3.
entrepreneur
458 PointsThank you for taking the time to answer,I solved it .