pythonATM自动存取款机7天密码保护
kh={1234567890:[‘123abc___@@@’,90000,‘aq’],1234567891:[‘223abc___@@@’,60000,‘aq’],1234567892:[‘323abc___@@@’,120000,‘aq’]}
class Y():
@staticmethod
def srmm():
global mm
while True:
xm=input(‘請輸入您的密碼:’)
mm=input(‘請輸入您的密碼:’)
if xmmm and len(mm)>=4:
pass
else:
print(‘兩次卡號不一致,或卡號太短’)
continue
count=0
if mm[-3]’@’:
count+=1
for i in mm:
if i==’_’:
count+=1
break
for i in mm:
if ‘0’<=i<=‘9’:
count+=1
break
for i in mm:
if ‘a’<=i<=‘z’ or ‘A’<=i<=‘Z’:
count+=1
break
if count==4:
z=[]
z.append(mm)
z.append(f)
z.append(‘aq’)
kh[int(k)]=z
print(kh)
break
else:
print(‘密碼不符合規范’)
@staticmethod
def zczh():
global k
global f
while True:
k = input(‘請輸入要注冊的卡號’)
if k.isdigit()False or len(k)<10 or len(k)>13 :
print(‘卡號不符合規范,請重新輸入’)
continue
elif int(k) in kh.keys():
print(‘卡號已存在’)
continue
else:
break
f = 0
Y.srmm()
#Y.zczh()
from zc import *
import time
cz=input(‘請選擇操作,注冊1,登錄其他’)
if cz’1’:
Y.zczh()
else:
pass
while True:
judge = True
while judge:
k = int(input(‘請插入銀行卡:’))
if k in kh:
if kh[k][2] == ‘SS’:
sj2 = time.time()
sj3 = int(sj1 + 180 - sj2)
if sj3 <= 0:
kh[k][2] = ‘aq’
else:
t = sj3 // 86400
s = sj3 % 86400 // 3600
f = sj3 % 3600 // 60
m = sj3 % 60
print(‘已經鎖住該卡,請于%d天%d時%d分%d秒后再來’ % (t, s, f, m))
continue
m = kh[k][0]
i = 3
while i != 0:
i -= 1
b = input(‘請輸入密碼:’) # 不加int得到是字符串
if b == m:
print(‘密碼正確,程序正在運行,請稍后…’)
judge = False
time.sleep(1)
break
elif i != 0:
kh[k][2]=‘SS’
print(‘密碼錯,請重新輸入,您還有’, i, ‘次機會’)
else:
print(‘密碼已錯誤三次,請退卡,明日再試或聯系客服!’)
sj1=time.time()
break
else:
print(‘系統不能識別銀行卡,請重新插入’)
while True:
print(‘歡迎使用ATM取款機:1、余額查詢’, ‘2、取款’,‘3、存款’, ‘4、修改密碼’, ‘5、轉賬’, ‘6、退卡’)
z = int(input(‘請選擇您要進行的操作:’))
f = kh[k][1]
n = str(f)
# 卡里金額
if z == 1:
print(‘您的銀行卡余額為%d元’ % f)
elif z == 2:
while True:
f=kh[k][1]
x = int(input(‘請輸入您要取現的金額:’))
if x % 100 == 0:
if x > f:
print(‘余額不足,請重新輸入’)
else:
f -= x
print(‘取現成功,取現金額%d元’ % x)
print(‘剩余金額%d元’ % f)
kh[k][1] = f
time.sleep(1)
break
else:
print(‘請輸入整百金額’)
elif z == 3:
while True:
f=kh[k][1]
x = int(input(‘請存入您要存進的金額:’))
if x % 100 == 0:
f+=x
print(‘存款成功,存款金額%d元’ % x)
print(‘剩余金額%d元’ % f)
kh[k][1] = f
time.sleep(1)
break
else:
print(‘請輸入整百金額’)
elif z == 4:
f=kh[k][0]
Y.srmm()
elif z == 5:
pd = True
while pd:
l = str(input(‘請輸入您要轉賬的賬號:’))
if l in kh:
while True:
o = int(float(input(‘請輸入您要轉賬的金額:’)))
if o > 20000:
print(‘當天轉賬金額最高為2w,請重新輸入’)
elif o > f:
print(‘余額不足,請重新輸入’)
else:
f -= o
print(‘轉賬成功,轉賬金額%d元’ % o)
print(‘剩余金額%d元’ % f)
kh[k][1] = f
kh[l][1] = kh[l][1] + o
time.sleep(1)
pd = False
break
else:
print(‘系統不能識別銀行卡卡號,請重新輸入’)
elif z == 6:
break
else:
print(‘系統不能識別您的操作,請重新輸入’)
s = input(‘是否退出系統,1,1退出,其他,繼續’)
if s == ‘1’:
break
else:
print(‘系統繼續運行’)
總結
以上是生活随笔為你收集整理的pythonATM自动存取款机7天密码保护的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python飞机大战3关BOSS
- 下一篇: python华为面试题10个人数3获取下