Skip to content

Instantly share code, notes, and snippets.

@NurettinSelim
Created December 22, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NurettinSelim/591cd99701e159bccd61e11e1e719a5b to your computer and use it in GitHub Desktop.
Save NurettinSelim/591cd99701e159bccd61e11e1e719a5b to your computer and use it in GitHub Desktop.
#KeroKOD Python Projeleri Part: 4 / www.kerokod.com
def kucukHarf(sifre):
kucukListe = ['a', 'b', 'c', 'ç', 'd', 'e', 'f', 'g', 'ğ', 'h', 'i', 'ı', 'j',
'k', 'l', 'm', 'n', 'o', 'ö', 'p', 'r', 's', 'ş', 't', 'u', 'ü', 'v', 'y', 'z']
for harf in sifre:
for kontrolHarf in kucukListe:
if harf == kontrolHarf:
return True
return False
def buyukHarf(sifre):
buyukListe = ['A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'İ', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z']
for harf in sifre:
for kontrolHarf in buyukListe:
if harf == kontrolHarf:
return True
return False
def sayi(sifre):
sayiListe = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for harf in sifre:
for kontrolHarf in sayiListe:
if harf == kontrolHarf:
return True
return False
def kontrol(sifre):
isKucuk = kucukHarf(sifre)
isBuyuk = buyukHarf(sifre)
isSayi = sayi(sifre)
if len(sifre)<16 and len(sifre)>6:
uzunluk = True
else:
uzunluk = False
if isBuyuk == True and isKucuk == True and uzunluk == True and isSayi == True:
print("Şifreniz güçlü bir şifredir")
else:
print("Şifreniz zayıf bir şifre")
print("""Güçlü şifrenin sırları
1-En az 1 büyük harf bulundurmak
2-En az 1 küçük harf bulundurmak
3-En az 1 sayı bulundurmak
4-En az 6 en fazla 16 karakterden oluşması""")
kullaniciSifre = input("Şifrenizi giriniz:")
kontrol(kullaniciSifre)
#Nurettin Selim @makernurettin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment