Steven Gutierrez2,976 Points
Am I putting IF statement in the wrong place?
Is IF in the wrong place?
def loopy(items): for item in (items): print(item) if item == "STOP": break
Hi there! Yes, it is. Currently your code will print the word "STOP" if it's entered because it does the print before the check. We want to print everything but "STOP" then exit if it is "STOP". Also, your
if statement should be inside the
Hope this helps!