Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
61e948e3
authored
Sep 06, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
2e0f1a38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
4 deletions
diy.py
diy.py
View file @
61e948e3
# 和你的小伙伴用列表讲讲桃园结义的故事,并说说这其中运用了哪些列表知识:
# 来,我给你起个头~
# 从前啊,有三个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
(
"登录成功"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment