Skip to content

Instantly share code, notes, and snippets.

Created November 19, 2011 10:13
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 anonymous/1378687 to your computer and use it in GitHub Desktop.
Save anonymous/1378687 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
def checkfermat(a,b,c,n):
for value in [a,b,c,n]:
if value != int(value): print(value, "is not a proper integer"); break
if a**n + b**n == c**n: print("This case proves Fermat's theorem wrong.")
else: print("The theory holds.")
def supplyargs(a,b,c,n):
string, set = "null", [a,b,c,n]
while string != "ready":
print ("values are a:{0}, b:{1}, c:{2}, n:{3}".format(set[0], set[1], set[2], set[3]))
string = raw_input("type a,b,c, or n followed by a dash and the number, or [Return]: ")
if string == "": checkfermat(a,b,c,n); break
if int(string[0]) in set: set[set.index(int(string[0]))] = int(string[2])
else: pass
print set
supplyargs(3,4,5,6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment