diff --git a/e031.py b/e031.py index cf58638..ebd6be8 100644 --- a/e031.py +++ b/e031.py @@ -25,6 +25,9 @@ def combinations(amount, denominations): n += 1 return total -if __name__ == '__main__': +def main(): coins = [200, 100, 50, 20, 10, 5, 2, 1] print combinations(200, coins) + +if __name__ == '__main__': + main() diff --git a/e059.py b/e059.py index 8b442dd..b79891f 100644 --- a/e059.py +++ b/e059.py @@ -87,7 +87,7 @@ def get_key(encrypted, key_len=3): return sorted([s for s in scored if s[0] > 1]) -if __name__ == '__main__': +def main(): #e = encrypt('Myles is a ridiculous dog who loves his bone', 'amz') #print get_key(e) with open(os.path.join(os.path.dirname(__file__), 'p059', 'cipher1.txt'), 'r') as codefile: @@ -99,3 +99,5 @@ if __name__ == '__main__': print d print 'Sum:', sum([ord(c) for c in d]) +if __name__ == '__main__': + main()