Skip to content

Instantly share code, notes, and snippets.

@bakialmaci
Created November 3, 2017 20:12
Show Gist options
  • Save bakialmaci/657b1efca26c5a361e5d3c2a87df1058 to your computer and use it in GitHub Desktop.
Save bakialmaci/657b1efca26c5a361e5d3c2a87df1058 to your computer and use it in GitHub Desktop.
Finding Lucky Number with PYTHON 3
sayilar = input('Enter numbers: ').split(",")
for sayi in sayilar:
print("",end='')
sayi = int(sayi)
list=range(-1,sayi,2)
i=2
while list[i:]:list=sorted(set(list)-set(list[list[i]::list[i]]));i+=1
print("The Lucky Numbers:",list[1:sayi+1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment