This file contains hidden or 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
# prints lychrel candidate numbers up to 10000 | |
lychrels = set() | |
not_lychrels = set() | |
seeds = set() | |
def is_palindrome(n): | |
n_str = str(n) | |
if n_str[::-1] == n_str: | |
return True |
This file contains hidden or 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
# displays alphanumeric character count and sum of digits in file | |
import sys | |
if len(sys.argv) < 2: | |
print "Usage: python charcount.py <input.txt>" | |
exit() | |
f = open(sys.argv[1]) |