Commit b12c2cac by BellCodeEditor

save project

parent 368cd025
Showing with 14 additions and 24 deletions
i=3 a=[1,2,3,4,5,6,7,8,9,0]
username = "python" def h(n):
userpassword = "123456" l=0
while True: r=len(a)
if i>0: while l<=r:
name = input("请输入用户名:") mid=(l+r)//2
password = input("请输入密码:") if mid==n:
i-=1 print(1)
if name == username and password == userpassword: if mid<n:
print("登录成功!") l=mid+1
break else :
elif username!=name: r=mid-1
print("用户名!请重新输入") h(10)
print("温馨提是:你还有"+str(i)+"机会") h(3)
continue
else:
print("密码错误!请重新输入")
print("温馨提是:你还有"+str(i)+"机会")
else:
print("你的用户已被锁定!")
exit()
print("欢迎来到贝尔编程!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment