Skip to content

Instantly share code, notes, and snippets.

@yoavram
Created November 7, 2011 09:53
Show Gist options
  • Save yoavram/1344581 to your computer and use it in GitHub Desktop.
Save yoavram/1344581 to your computer and use it in GitHub Desktop.
def smallest_divisor(n):
div=2
while n%div!=0:
div = div+1
return div
print "Smallest divisor of",2011,"is",smallest_divisor(2011)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment