Skip to content

Instantly share code, notes, and snippets.

@fatih
Created August 15, 2012 12:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatih/3359902 to your computer and use it in GitHub Desktop.
Save fatih/3359902 to your computer and use it in GitHub Desktop.
Rastgele TC Kimlik No üreticisi
#!/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
@gizemdobby
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment