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 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,322 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