Last active
December 22, 2015 02:59
-
-
Save mehmetkose/6407136 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import random | |
kuponsayisi = 40000 | |
kuponlar = [] | |
ii = 0 | |
while ii < kuponsayisi: | |
kupon = "" | |
i = 0 | |
while i < 15: | |
kupon = kupon + str(random.randint(0,2)) | |
i = i+1 | |
if not kupon in kuponlar: | |
kuponlar.append(kupon) | |
ii = ii +1 | |
sonuc = '202211212102121' | |
#tabiki örnek | |
for kupon in kuponlar: | |
z = 0 | |
eslesen = 0 | |
while z < 15: | |
if sonuc[z] == kupon[z]: | |
eslesen = eslesen +1 | |
z = z+1 | |
if eslesen > 12: | |
print str(eslesen) + " : " + (kupon) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment