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 trialJake Liebetrau
Python Development Techdegree Student 763 PointsUnsure why I receive the error as follows: Error: test_exception_not_raised (_main_.TestRaiseExcecution)
import math
def suggest(product_idea):
if len(product_idea) < 3:
raise ValueError("Please try again.")
return product_idea + "inator"
try:
product_idea = input("What is your product name? ")
new_name = suggest(product_idea)
except ValueError as err:
print("Oh no! At least 3 characters are required to create a name")
print("({})".format(err))
else:
print("The brand new product name is {}".format(new_name))
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsHey Jake Liebetrau, the error you see is caused by the input
statement. The checker executes your code with specific expectations. When the checker hits an unexpected input
statement, it doesnβt have any input to offer so the checker effectively hangs. The error you see is raised by internal checker code.
Post back if you need more help. Good luck!!!
Jake Liebetrau
Python Development Techdegree Student 763 PointsJake Liebetrau
Python Development Techdegree Student 763 PointsI've discovered the correct way to complete this challenge but I am still interested in why I had the error for the rest of the code.