-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraise.py
More file actions
41 lines (32 loc) · 1.06 KB
/
Copy pathraise.py
File metadata and controls
41 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def check_password(psw):
import re
if len(psw)<8:
raise Exception ("parola en az 7 karakter olmalıdır.")
elif not re.search("[a-z]",psw):
raise Exception ("parola küçük harf içermelidir.")
elif not re.search("[A-Z]",psw):
raise Exception ("parola büyük harf içermelidir.")
elif not re.search("[0-9]",psw):
raise Exception ("parola rakam içermelidir.")
elif not re.search("[_@$]",psw):
raise Exception ("parola alpha numeric harf içermelidir.")
elif re.search("[\s]]",psw):
raise Exception ("parola boşluk içermemelidir.")
else:
print("geçerli parola")
password = input("şifre gir: ")
try:
check_password(password)
except Exception as ex:
print(ex)
else:
print("geçerli parola;elseden")
finally:
print("validation tamalandı. ")
# class Person:
# def __init__(self, name, year):
# if len(name)>10:
# raise Exception("name alanı fazla karakter içeriyor. ")
# else:
# self.name = name
# p=Person("aliiiiiiiiii",1989)