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
Dorota Parzych
5,706 Pointspython basics challenge 1 of 1
I have got 2 errors and no idea what I can do about that and slove the challenge: I've made a function that creates brand new product names using "artificial intelligence".
I have a problem though, people keep on adding product ideas that are too short. It makes the suggestions look bad.
Can you please raise a ValueError if the product_idea is less than 3 characters long? product_idea is a string. Thanks in advance!
code in the beggining: def suggest(product_idea): return product_idea + "inator"
my code: def suggest(product_idea): product_idea = input("mo") #if lenght of product idea is smaller then 3.. if len(product_idea) <= 3: raise ValueError("It is too short! More then 3 char. ") else: return product_idea + "inator"
Maybe I overthought?
3 Answers
KRIS NIKOLAISEN
54,974 Pointsproduct_idea is passed in to the function so you won't need any input. The checker doesn't respond to the input function anyways so just delete that line and you should be good.
KRIS NIKOLAISEN
54,974 PointsLinus, based on the wording in the challenge it should be <=2 or < 3 but the challenge will also accept <= 3
Linus Jorenbo
507 PointsI am stuck at this one as well. But I am wondering about <=3. Shouldnt it be <=2? Otherwise 3characters ideas will be rejected too? Maybe I got it wrong.