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 Raising Exceptions

Can someone help me with this?

I need help I don't know what I'm doing wrong. /Users/IanRandallRoach/Desktop/Screen Shot 2019-06-17 at 5.37.26 PM.png

Can you post your code?

Steven Parker
Steven Parker
231,271 Points

We can't get to the screenshot image stored on your computer, but screenshots aren't very useful for debugging. But if you make a snapshot of your workspace and post the link to it here, we can replicate the issue and help find a solution.

It's not giving me the option to create a snapshot. My workspace looks different than the workspace on the video thats about how to make snapshots.

Steven Parker
Steven Parker
231,271 Points

Does it have a button with a camera icon on it somewhere?

Ok at first I was on the actual question. Now I just copied it to a workspace. I copy and pasted the link here. It's on the untitled.html section.

https://w.trhou.se/u8mfk57dve

2 Answers

Steven Parker
Steven Parker
231,271 Points

It looks like you were working on a challenge, but the button on this page leads to a video. Normally, if you create a question from the "get help" button in a challenge, it will provide a link to it and also include your code for you.

But based on the snapshot code, I see these issues:

  • it looks like some of the originally provided code was removed
  • some of the removed code handles the necessary "return" for the function
  • the added code needs to be indented further to be considered part of the function
  • it's not the "product_idea" itself you'll want to test, but the length of it ("len()" function)

The main problem looks like a lack of a "return", and the omission of a "len()" function to test for the length of characters. You should be able to fix it without much trouble.

For the challenge should I use the len function for the if statement?