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 trialyunus emre erdem
575 Pointsi don't understand what is problem
hey thanks for helping me out
def loopy(items):
# Code goes here
for things in items:
print (things)
if things = "STOP":
break
Marko Vasiljevic
Courses Plus Student 143 PointsI think error is in "if things = "STOP": try: if things == "STOP":
2 Answers
Timothy Donley
Python Web Development Techdegree Student 1,365 Pointsdef loopy(items):
for things in items:
if things == "STOP":
break
else:
print(things)
This is the correct code for all the tasks. The first problem that I see is you are printing things before you check is it "STOP". The spacing is also wrong as well. Remember the spacing is using logic for the computer to read what the code is trying to do. Also Reminder in a function the order is how its read.
yunus emre erdem
575 Pointsthanks timothy for this and previous one
Timothy Donley
Python Web Development Techdegree Student 1,365 Pointsno problem i will help when its on the forum.
yunus emre erdem
575 Pointsyunus emre erdem
575 PointsAlso could you help me about that one?
def loopy(items): # Code goes here for things in items: print (things) for things in items: things = "STOP" break break