Skip to content

Instantly share code, notes, and snippets.

@felipeborges
Created April 3, 2015 19:45
Show Gist options
  • Save felipeborges/984d65672a8724e7abb8 to your computer and use it in GitHub Desktop.
Save felipeborges/984d65672a8724e7abb8 to your computer and use it in GitHub Desktop.
def crazy_pow(i):
a = i - 25
b = 50 - i
return a*100 + b*b
for i in range(-100, 10000):
x = crazy_pow(i)
print("%d - %d expected = %d" % (i, x, i**2))
if (x != i**2):
print("ERR")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment