Created
January 1, 2019 11:22
-
-
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.
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
#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