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!
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
Kaden Currier1,490 Points
what did I do wrong
it says invalid syntax at "if items = "A"
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] # Your code here print("continents:") for items in continents: if items = "A" print("* " + items)
Sem Peters3,669 Points
The '=' is only used to SET values of variables, like
variable = 129
You should use the '==' operator to check whether something is equal to something.
So something like:
if items == "A"
would be correct.
The '=' is an assignment operator, the '==' is an operator used to compare. Also, your if-statement does not have indentation. It should, just like you did with the for-loop. The following code should be correct:
for items in continents: if items == "A" print("* " + items)