Commit 4d95a8f1 by BellCodeEditor

save project

parent 57b18f02
Showing with 48 additions and 11 deletions
import turtle
p=turtle.Pen()
s=turtle.Screen()
i=3
username = "python"
userpassword = "123456"
while True:
if i>0:
p.penup()
p.goto(0,0)
name = s.textinput("请输入用户名:","VVVVVVV")
password = s.textinput("请输入密码:","VVVVVVV")
if name == username and password == userpassword:
s.clear()
p.write("登录成功!",font=("Times",10,"normal"))
break
if name!=username:
s.clear()
p.write("用户名错误",font=("Times",10,"normal"))
i-=1
p.goto(0,20)
p.write("您还剩"+str(i)+"次输入机会",font=("Times",10,"normal"))
elif userpassword!=password:
s.clear()
p.write("密码错误",font=("Times",10,"normal"))
p.goto(0,10)
i-=1
p.write("您还剩"+str(i)+"次输入机会",font=("Times",10,"normal"))
else:
p.write("你的账户已被锁定,请带身份证来我司解锁",font=("Times",10,"normal"))
exit()
p.goto(0,-20)
p.write("====================",font=("Times",10,"normal"))
p.goto(0,-40)
p.write("欢迎来到贝尔编程!",font=("Times",10,"normal"))
p.goto(0,-60)
p.write("====================",font=("Times",10,"normal"))
turtle.done()
\ No newline at end of file
i=10 i=3
username = "python" username = "python"
userpassword = "123456" userpassword = "123456"
while True: while True:
...@@ -11,17 +11,13 @@ while True: ...@@ -11,17 +11,13 @@ while True:
if name!=username: if name!=username:
print("用户名错误") print("用户名错误")
i-=1 i-=1
print("您还剩"+str(i)+"次输入机会") continue
continue
elif userpassword!=password: elif userpassword!=password:
print("密码错误") print("密码错误")
i-=1 elif name!=username and userpassword!=password:
print("您还剩"+str(i)+"次输入机会") print("输入错误")
else: else:
print("你的账户已被锁定,请带身份证来我司解锁") print("你的账户已被锁定,请带身份证来我司解锁")
exit() exit()
print("====================") print("欢迎来到贝尔编程!")
print("欢迎来到贝尔编程!") \ No newline at end of file
print("====================")
while True:
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaa")
\ No newline at end of file
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