Skip to content

Instantly share code, notes, and snippets.

@sanfx
Created April 8, 2014 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanfx/10112791 to your computer and use it in GitHub Desktop.
Save sanfx/10112791 to your computer and use it in GitHub Desktop.
week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thurs', 'Fri']
print "If you break out of For else doesnt execute becuase its a part of for loop."
print "Enter something/ some single letter."
var = raw_input('>>')
msg = ''
for day in week:
print day
if day.endswith(var):
break
msg = "No day ends with %s" % var
else:
print 'Weekend'
print msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment