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

Is something wrong with my "Code !" :(

def suggest(product_idea):

if len(product_idea) < 3:

    raise ValueError("Please suggest with minimum 3 characters")

return product_idea + "inator"

[MOD: added ```python formatting -cf]

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,468 Points

The indentation of the if statement and the return statement is insufficient. They both should be inside the def statement. Remember to keep the raise statement inside the if block as it is indented.

Post back if you need more help. Good Luck!!

Thank you Chris! I understand indentation is most Important when we write code or when we create method.

print("Test completed !")

Thank you for supporting me.

Provided your indentation is correct then our code appears to be correct. Did it not pass the challenge?

After reading your hint, which is provided above, I just used the tab key and It make my code correct! Yes! I passed the test.

Thank you Kris :)