Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_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
de620162
authored
Sep 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c9a9e494
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
diy1.py
diy1.py
View file @
de620162
username
=
"
python
"
# 保存在服务器数据库中的用户账号(正确的账号)
username
=
"
0
"
# 保存在服务器数据库中的用户账号(正确的账号)
userpassword
=
"
123456
"
# 保存在服务器数据库中的用户密码(正确的密码)
userpassword
=
"
0
"
# 保存在服务器数据库中的用户密码(正确的密码)
k
=
3
# 请用input()实现用户输入账号、密码的功能
# 请用input()实现用户输入账号、密码的功能
while
True
:
while
True
:
name1
=
input
(
"请输入正确的账号:"
)
if
k
>
0
:
name2
=
input
(
"请输入正确的密码:"
)
name1
=
input
(
"请输入正确的账号:"
)
if
name1
==
username
and
name2
==
userpassword
:
name2
=
input
(
"请输入正确的密码:"
)
print
(
"登陆成功!"
)
if
name1
==
username
and
name2
==
userpassword
:
print
(
"欢迎来到厕所!!!!!!!!!"
)
print
(
"登陆成功!"
)
break
print
(
"欢迎来到厕所!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!AWAEWSZDSRFSDDERDSRESRTESTRSTRDSRTDYTFYTFYTRDTRDRDRSRRDTFYFUYUGHKUHUKHUHIYUGUTYDFFCVB VJNHBNMNUHYGYFTFDRYCHGJKUIG HGYUFTFJKGYGVUY GUYGUYFTDDYJUHMHJGI IGYGYIUIGYGIUHIUGIHUG UIGGIGD
%
FYTGJHBKUHHJGHJGJVBJ BJGBJHGJHVNMBV "
)
if
name1
!=
username
:
break
print
(
"账号错误
\n
hhh!!!!!
\n
hhh!!!!!
\n
hhh!!!!!"
)
if
name1
!=
username
:
continue
print
(
"账号错误
\n
hhh!!!!!
\n
hhh!!!!!
\n
hhh!!!!!"
)
if
name2
!=
userpassword
:
k
=
k
-
1
print
(
"密码错误
\n
hhh!!!!
\n
hhh!!!!
\n
hhhh!!!!!!"
)
print
(
"你还有"
+
str
(
k
)
+
"次机会"
)
continue
if
name2
!=
userpassword
:
print
(
"密码错误
\n
hhh!!!!!
\n
hhh!!!!!
\n
hhhh!!!!!"
)
k
=
k
-
1
print
(
"你还有"
+
str
(
k
)
+
"次机会"
)
else
:
print
(
"三次都输不对!
\n
hhh!!!!!!
\n
hhh!!!!!
\n
hhh!!!!!"
)
print
(
"弱诶!密码是0!"
)
exit
()
...
...
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