Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jamesperes-zz/1efac8953642b4b25a107f9834903c93 to your computer and use it in GitHub Desktop.
Save jamesperes-zz/1efac8953642b4b25a107f9834903c93 to your computer and use it in GitHub Desktop.
andre.py
minimo = 100
maximo = 1000
lista_pali = []
lista_resul = []
for i in range(1, 999999):
num_str = str(i)
num_str_invertido = num_str[::-1]
if num_str == num_str_invertido:
lista_pali.append(num_str)
for i in range(minimo + 1, maximo):
for j in range(minimo, maximo + 1):
multi = i * j
multi_str = str(multi)
if any(multi_str in s for s in lista_pali):
if len(multi_str) == 6:
if multi_str.find('9') == 0:
k = int(multi_str)
lista_resul.append(multi)
print(' %d x %d =%s' % (i, j, multi))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment