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 trialSohail Mirza
Python Web Development Techdegree Student 5,158 PointsBoolean - 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
Python Web Development Techdegree Student 38,322 PointsCraig is getting True because taco is in ca*taco*mbs
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
Sohail Mirza
Python Web Development Techdegree Student 5,158 PointsHi Henrik Putting the typo aside which i corrected (Thanks) why do i get false the example which Craig gave was true
seong lee
4,503 Pointsyou also spelled special wrong on the second line
seong lee
4,503 Pointsoh nevermind that was already clarified