Created
August 15, 2012 12:53
-
-
Save fatih/3359902 to your computer and use it in GitHub Desktop.
Rastgele TC Kimlik No üreticisi
This file contains 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 -*- | |
# Without tk: http://rastgele-tc-kimlik-no-uretici.googlecode.com/svn/trunk/rastgele-tc-kimlik-no-uretici.py | |
from random import randint | |
while True: | |
tcno = randint(10000000000,99999999999) | |
tc = str(tcno) | |
listetc = [int(tc[i]) for i in range(11)] | |
tc10 = 0 | |
for i in range(0,10,2): | |
tc10 += listetc[i] | |
tc10 *= 7 | |
for i in range(1,9,2): | |
tc10 -= listetc[i] | |
tc10 %= 10 | |
tc11 = tc10 | |
for i in range(0,9): | |
tc11 += listetc[i] | |
tc11 %= 10 | |
if listetc[9] == tc10 and listetc[10] == tc11: | |
print tcno | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For kayitx = 10000000000# To 99999999999#
If TCKimlikNoYazimKontrol(kayitx) = False Then
Me.SUNUC = "HATALI"
Me.TCNO = kayitx
Else
Me.SUNUC = "GERÇEK"
Me.TCNO = kayitx
End If
DoCmd.GoToRecord , , acNewRec
Next