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
0a38b6ae
authored
Jan 30, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
b4f212e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
diy1.py
dslaksa.py
diy1.py
View file @
0a38b6ae
i
=
3
usern
e
me
=
"python"
usern
a
me
=
"python"
userpassword
=
"123456"
userpassword
=
"123456"
while
True
:
while
True
:
usersname
=
input
(
"请输入账号:"
)
if
i
>
0
:
if
usersname
!=
username
:
usersname
=
input
(
"请输入账号:"
)
print
(
"账号错误,请重新输入"
)
if
username
!=
usersname
:
continue
print
(
"账号错误,请重新输入"
)
userspassword
=
input
(
"请输入密码:"
)
continue
if
usersname
==
username
and
userspassword
==
userpassword
:
userspassword
=
input
(
"请输入密码:"
)
print
(
"登陆成功"
)
if
usersname
==
username
and
userspassword
==
userpassword
:
break
print
(
"登陆成功"
)
break
else
:
print
(
"密码错误,请重新输入"
)
i
-=
1
else
:
else
:
print
(
"密码错误,请重新输入"
)
print
(
"错误次数已超出,已冻结。"
)
exit
()
print
(
"欢迎来到贝尔编程!"
)
print
(
"欢迎来到贝尔编程!"
)
\ No newline at end of file
dslaksa.py
View file @
0a38b6ae
userneme
=
"python"
userneme
=
"python"
userpassword
=
"123456"
userpassword
=
"123456"
while
True
:
while
True
:
...
@@ -10,6 +11,9 @@ while True:
...
@@ -10,6 +11,9 @@ while True:
userspassword
=
input
(
"请输入密码:"
)
userspassword
=
input
(
"请输入密码:"
)
if
userspassword
!=
userpassword
:
if
userspassword
!=
userpassword
:
print
(
"密码错误,请重新输入"
)
print
(
"密码错误,请重新输入"
)
i
-=
1
else
:
else
:
else
:
break
break
print
(
"登陆成功,欢迎来到python世界!"
)
print
(
"登陆成功,欢迎来到python世界!"
)
\ 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