#!/usr/bin/python
# -*- coding: UTF-8 -*-
創(chuàng)新互聯(lián)公司專業(yè)成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),集網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)、網(wǎng)站制作于一體,網(wǎng)站seo、網(wǎng)站優(yōu)化、網(wǎng)站營(yíng)銷、軟文發(fā)稿等專業(yè)人才根據(jù)搜索規(guī)律編程設(shè)計(jì),讓網(wǎng)站在運(yùn)行后,在搜索中有好的表現(xiàn),專業(yè)設(shè)計(jì)制作為您帶來(lái)效益的網(wǎng)站!讓網(wǎng)站建設(shè)為您創(chuàng)造效益。
def account_login(account):
if account in Dict.keys():
tmp=Dict[account]
password=input("enter the password:")
if password in tmp.keys():
if tmp[password] == 0:
return 0
else:
return 3
else:
print('Error password:')
return 1
else:
return 2
def lock_account(account):
for k in Dict:
if k == account:
for subk in Dict[k]:
Dict[k][subk]=1
def try_times(account):
num=3
while num>0:
result=account_login(account)
if result == 1:
num=num-1
if num == 0:
lock_account(account)
print('The account %s is locked now!'%account)
exit()
elif result == 2:
print('no account')
exit()
elif result == 3:
print('The account was locked')
exit()
elif result == 0:
print('success login on the %s!'%account)
break
list1 = []
list2 = []
def check_intnumber(n):
if int(n) % 2 == 0:
return True
else:
return False
def append_list(arg_list):
global list1
global list2
for i in arg_list:
if check_intnumber(i) == True:
list1.append(i)
elif check_intnumber(i) == False:
list2.append(i)
def filit_number(arg):
arg_list = arg.split(',')
for i in arg_list:
if str.isdigit(i) == False:
arg_list.remove(i)
else:
pass
return arg_list
def main():
account=input("enter the accout:")
try_times(account)
arg = input('enter someting to check:')
arg_list = filit_number(arg)
append_list(arg_list)
print('odd number',list2)
print('even number',list1)
if __name__ == '__main__':
Dict = {'oracle': {'a123': 0}, 'root': {'b123': 0}, 'MySQL': {'c123': 1}}
main()
##新手小試牛刀,主要執(zhí)行功能前需要用戶驗(yàn)證,其中用戶字典里面0表示正常 1表示用戶被鎖