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 trialThomas Eruchie
Python Web Development Techdegree Student 1,175 Pointsexception handling relating to max length of a character
this is a quiz relating to throwing an exception when certain length of character input is less than 3
def suggest(product_idea):
return product_idea + "inator"
3 Answers
Jeff Muday
Treehouse Moderator 28,722 PointsThomas,
What is your question on the challenge? Hint, it should look something like this:
def suggest(product_idea):
# some code goes here that will throw an error
return product_idea + "inator"
Thomas Eruchie
Python Web Development Techdegree Student 1,175 Pointsi did this
def suggest(product_idea): if product_idea < 3 : raise ValueError("it should be above 3") return product_idea + "inator" product_idea = input("Do you understand? ") product_idea = len(product_idea)
Jeff Muday
Treehouse Moderator 28,722 PointsThomas, nice work on that.
Kenneth places plenty of emphasis on how to raise errors. It really makes troubleshooting code much easier.
Thomas Eruchie
Python Web Development Techdegree Student 1,175 PointsThomas Eruchie
Python Web Development Techdegree Student 1,175 Pointsyes that how it is. i converted string to get lenght and if it less than 3 it raise valueerror exception