Skip to content

Instantly share code, notes, and snippets.

@tpdn
Last active August 29, 2015 13:55
Show Gist options
  • Save tpdn/8750622 to your computer and use it in GitHub Desktop.
Save tpdn/8750622 to your computer and use it in GitHub Desktop.
某面接でその場で書けと言われたやつ。手書きした時はいろいろ文法ミスってたような気がするし、rangeをListの展開でアレしてたりするダメコード書いてたような気もする。
def prime(n):
if n is 0 or n is 1:
return False
else:
for x in range(2,n):
if n % x is 0:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment