Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_7
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
37cb03b8
authored
Mar 12, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
9dce5a6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
dd.py
dd.py
0 → 100644
View file @
37cb03b8
name1
=
"光头强"
key1
=
12345
name2
=
"熊大"
key2
=
54188
name3
=
"熊二"
key3
=
14588
life
=
3
while
True
:
print
(
"*"
*
50
)
selfname
=
input
(
"请输入用户名:"
)
selfkey
=
input
(
"请输入密码:"
)
print
(
"*"
*
50
)
life
=
life
-
1
if
selfname
==
name1
:
if
selfkey
==
str
(
key1
):
print
(
"登录成功!"
)
print
(
"*"
*
50
)
exit
()
else
:
print
(
"密码错误!"
)
print
(
"您还剩"
+
str
(
life
)
+
"次机会!"
)
elif
selfname
==
name2
:
if
selfkey
==
str
(
key2
):
print
(
"登录成功!"
)
print
(
"*"
*
50
)
exit
()
else
:
print
(
"密码错误!"
)
print
(
"您还剩"
+
str
(
life
)
+
"次机会!"
)
elif
selfname
==
name3
:
if
selfkey
==
str
(
key3
):
print
(
"登录成功!"
)
print
(
"*"
*
50
)
exit
()
else
:
print
(
"密码错误!"
)
print
(
"您还剩"
+
str
(
life
)
+
"次机会!"
)
print
(
"*"
*
50
)
else
:
if
life
==
0
:
print
(
"您已登录失败3次!账号已冻结!"
)
print
(
"*"
*
50
)
exit
()
else
:
print
(
"登陆失败,没有此账号!请重新输入!"
)
print
(
"您还剩"
+
str
(
life
)
+
"次机会!"
)
print
(
"*"
*
50
)
\ No newline at end of file
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