-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword_pincode.py
More file actions
44 lines (30 loc) · 1.11 KB
/
Copy pathpassword_pincode.py
File metadata and controls
44 lines (30 loc) · 1.11 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
defaul_pincode = '1357'
user_pin = ''
correctpin = False
from time import sleep
## check pin code
for counter in range(1,3):
for chance in range(1,4):
## get and check format pin code from user
for i in range(100):
user_pin = input('-Please enter 4 digit pin code: ')
if user_pin.isnumeric() and len(user_pin) == 4:
break
else:
print('-Pin code format is wrong! try again!')
# print('your pin code is %s .' % user_pin)
if defaul_pincode == user_pin:
print('device unlocked!!!')
correctpin = True
break
else:
if chance==3:
if counter==1:
print('you have no more chance! try again in 10 second!')
sleep(2)
else:
print('you have no more chanse!! call with costumer support!!')
else:
print('wrong pin code! try again!! you have %i more chance' %(3-chance))
if correctpin == True:
break