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 Python Basics Functions and Looping Raise an Exception

Brian Hampton
Brian Hampton
960 Points

Trying to convert the string length to an integer, Not sure if I'm doing this properly to get pass this step.

My attempt at this was to get the length of 'product_idea' but I'm running into string objects not having a len attribute. Is there another way to solve this equation that I cannot think of at the moment?

Cooper Runstein
Cooper Runstein
11,850 Points

Can you share your code? You have the right idea, unless I see the code I can't tell you exactly what went wrong.

1 Answer

Daniel Maslany
seal-mask
.a{fill-rule:evenodd;}techdegree
Daniel Maslany
Full Stack JavaScript Techdegree Student 6,193 Points

You don't need to convert len into a intger as it's already returning a value in that format.

if len(product_idea) < 5:
    print(product_idea, " is to short. Pick a name with five or more letters.")
else:
    print(product_idea, " is a great name!")