Skip to content

Instantly share code, notes, and snippets.

@ozgurkaracam
Created January 1, 2019 11:22
Show Gist options
  • Save ozgurkaracam/abab43939734111d3aeb221f4b66d35a to your computer and use it in GitHub Desktop.
Save ozgurkaracam/abab43939734111d3aeb221f4b66d35a to your computer and use it in GitHub Desktop.
4,5 ve 6 basamaklı, tersi, 4 katına eşit olan sayıları bulan algoritma.
#python 3.7.x ile derlenmiştir.
# [2178, 21978, 219978]
def is_palindrom(foo,bar):
n1=list(str(foo))
n2=list(str(bar))
if n1==n2[::-1]:
return True
else:
return False
def controleq(foo):
return is_palindrom(foo,foo*4)
#main func.
list1=[]
for numb in range(1000,999999):
if controleq(numb):
list1.append(numb)
print(list1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment