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.

Didier Borel
2,837 Pointsfor loop print items
i don't quite see what I am doing wrong here
def loopy(items):
for:input("> ")
print(input)
if: input=="STOP":
break
3 Answers

Tatiana Perry
17,156 Pointsdef loopy(items):
for item in items:
if item == "STOP":
break
print(item)
The if/break statement needs to be inside the loop before print.

Didier Borel
2,837 Pointsthxs Tatiana,
2 questions. what is the difference between == and = (1 or 2 equal signs)
and how do we know that item is a word python will understand, and differentiaite from items? is there a list of words or variables that python knows. ?
thxs

Steven Parker
220,513 Points- Two signs (==) is a test: "are these equal?". Just one = is an assigment: "copy the right side to the left side".
- You're talking about reserved words / language keywords. They are listed in the offical python docs.

Didier Borel
2,837 Pointsthis Steven. that answers my question