Skip to content

Instantly share code, notes, and snippets.

@sincerefly
Created April 29, 2015 13:26
Show Gist options
  • Save sincerefly/324e01601607516f327c to your computer and use it in GitHub Desktop.
Save sincerefly/324e01601607516f327c to your computer and use it in GitHub Desktop.
判断吸血鬼数
#吸血鬼数: http://zh.wikipedia.org/wiki/%E5%90%B8%E8%A1%80%E9%AC%BC%E6%95%B8
def vampire_test(x, y):
print sorted(str(x) + str(y))
return sorted(str(x * y)) == sorted(str(x) + str(y))
print vampire_test(21, 6)
# result: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment