Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Types and Branching Booleans

Sohail Mirza
seal-mask
.a{fill-rule:evenodd;}techdegree
Sohail Mirza
Python Web Development Techdegree Student 5,158 Points

Boolean - corecing value to be true

At the start of the video Craig gives an example of has_taco = "taco" in "catacombs" has_taco true

Using the above example i created my own one and i get false

has_special = "apple" in "orange"
has_spacial
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'has_spacial' is not defined

I don't understand why i am getting FALSE..Any ideas thanks in advance

5 Answers

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,319 Points

'apple' in 'oranges' should return FALSE, but the error from the given example is because of a typo

# Here the variable name is has_spEcial
has_special = "apple" in "orange"

# Here it's has_spAcial
has_spacial
seong lee
seong lee
4,503 Points

you also spelled special wrong on the second line

seong lee
seong lee
4,503 Points

oh nevermind that was already clarified