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, how would I write not greater than as part of an if statement

this is not working

 not > len(letter_guess) in new_word_list

1 Answer

Hey John,

I'm not sure what your program calls for specifically, but I'd suggest considering using the <= operator (less than or equal to), since it will evaluate to true so long as the value on the right hand side of the operator is less than or equal to the value on the left hand side.

The code:

if x <= 10:

could be read as "If x is less than or equal to ten", as well as "As long as x is not greater than ten".

Good luck with the course!

That should work, thanks