Created
November 19, 2011 10:13
-
-
Save anonymous/1378687 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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