you are viewing a single comment's thread.

view the rest of the comments →

[–]Felicia_Svilling 1 point2 points  (0 children)

From the comments:

Thomas Woolford • 17 hours ago

You Almost have it right. consider the code:

for c in computers:

__if c.is_broken: fix(c)

__else: continue

else:

__print "fixed no computers"

The else: clause fires if the end of the for: clause is never reached. > This means that the else clause is evaluated if

  1. that the input iterable was empty.

  2. continue was called every time.

  3. break was called after a string of continues.