Commit 61e948e3 by BellCodeEditor

auto save

parent 2e0f1a38
Showing with 72 additions and 4 deletions
# 和你的小伙伴用列表讲讲桃园结义的故事,并说说这其中运用了哪些列表知识:
# 来,我给你起个头~
# 从前啊,有三个bro,分别是:刘备、关羽、张飞...
\ No newline at end of file
"""
name="牛魔王"
power=100
b=["小虾米",30,"小虾米1",40,"小虾米2",50,"小虾米3",60]
for i in range(len(b)):
if i%2==1 and power>b[i]:
b.insert(i+1,name)
b.insert(i+2,power)
break
print(b)
"""
"""
a=["关羽","刘备","张飞"]
a.insert(2,"赵云")
a.extend(["黄忠","魏延"])
print(a)
"""
"""
a=[0,1,2,3,4,5,6]
b=[0,1,2,3,4,5,6,7,8,9,10]
a.extend(b[-4:1])
print(a)
"""
"""
a=[0,100]
while True:
b=input("请输入0-100的整数\n")
c=int(b)
for i in range(len(a)):
if c<a[i] and c not in a:
a.insert(i,c)
break
print(a)
"""
"""
a=[0,1,2,3,4,5,6,7,8,9,10]
for i in range(len(a)):
if i%2==0:
print(a[i])
"""
x=username="python"
y=userpassword="123456"
i=0#用户名错误次数
j=0#密码错误次数
while True:
if i==3:
exit(0)
while i!=0:
print("您还有",3-i,"次机会")
break
a=input("请输入用户名\n")
if a==x:
break
else:
i=i+1
print("用户名错误")
while True:
if j==3:
exit(0)
if j==1:
print("您还有两次机会")
if j==2:
print("您还有一次机会")
b=input("请输入密码\n")
if b==y:
break
else:
j=j+1
print("密码错误")
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