-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraiseerror.py
More file actions
61 lines (40 loc) · 1.29 KB
/
raiseerror.py
File metadata and controls
61 lines (40 loc) · 1.29 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def pswcheck(psw):
import re
if len(psw)<8:
raise Exception("en az 8 karakter içermeli")
elif not re.search("[a-z]",psw):
raise Exception("en az bir tane küçük harf içerecek")
elif not re.search("[A-Z]",psw):
raise Exception("en az bir tane büyük harf içerecek")
elif not re.search("[0-9]",psw):
raise Exception("en az bir tane rakam içerecek")
elif not re.search(r"[!'^+%&/()=?*-]",psw):
raise Exception("en az bir tane alpha numerik harf içerecek")
elif re.search("\s",psw):
raise Exception("boşluk karakteri içermeyecek")
while True:
try:
x = input("password gir: ")
pswcheck(x)
except Exception as e:
print("passwsord'ü yanlış girdiniz: ", e)
else:
print("adam gibi girdiniz.....")
break
finally:
print("validation tamam.....")
# while True:
# try:
# x = int (input("x: "))
# y = int (input("y: "))
# print(x/y)
# except Exception as e:
# print(" x ve y'yi girerken tam sayı olarak girin!....", e)
# c = c + 1
# if c==3:
# print("hakkın bitti mal oğlan:)")
# break
# else:
# break
# finally:
# print("try except çalıştı....")