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
d61027bb
authored
Jan 25, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
fa625018
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
LRX.py
LRX1.py
LRX2.py
diy1.py
LRX.py
0 → 100644
View file @
d61027bb
i
=
0
while
i
<
6
:
print
(
i
)
i
+=
1
\ No newline at end of file
LRX1.py
0 → 100644
View file @
d61027bb
i
=
0
while
i
<=
10
:
if
i
%
2
==
0
:
print
(
i
)
i
+=
1
else
:
i
+=
1
\ No newline at end of file
LRX2.py
0 → 100644
View file @
d61027bb
count
=
0
while
True
:
print
(
"count的值为"
+
str
(
count
))
if
count
==
5
:
count
+=
1
continue
if
count
==
10
:
break
count
+=
1
print
(
"程序结束"
)
diy1.py
View file @
d61027bb
...
@@ -2,21 +2,32 @@ username = "python" # 保存在服务器数据库中的用户账号(正确
...
@@ -2,21 +2,32 @@ username = "python" # 保存在服务器数据库中的用户账号(正确
userpassword
=
"123456"
# 保存在服务器数据库中的用户密码(正确的密码)
userpassword
=
"123456"
# 保存在服务器数据库中的用户密码(正确的密码)
# 请用input()实现用户输入账号、密码的功能
# 请用input()实现用户输入账号、密码的功能
i
=
3
while
True
:
while
True
:
print
(
"输入你的账号、密码"
)
if
i
>
0
:
a
=
input
(
"账号:"
)
b
=
input
(
"密码:"
)
print
(
"输入你的账号、密码"
)
if
username
==
a
and
userpassword
==
b
:
a
=
input
(
"账号:"
)
print
(
"登录成功!"
)
b
=
input
(
"密码:"
)
break
if
username
==
a
and
userpassword
==
b
:
if
username
!=
a
:
print
(
"登录成功!"
)
print
(
"账号错误!请重新输入"
)
break
#跳出循环
if
username
==
a
:
if
username
!=
a
:
if
userpassword
!=
b
:
print
(
"账号错误!请重新输入"
)
print
(
"密码错误!请重新输入"
)
i
-=
1
print
(
"温馨提示:您还有"
+
str
(
i
)
+
"次机会"
)
elif
userpassword
!=
b
:
print
(
"密码错误!请重新输入"
)
i
-=
1
print
(
"温馨提示:您还有"
+
str
(
i
)
+
"次机会"
)
else
:
print
(
"您的账户已被锁定,请带身份证来我司解锁"
)
exit
()
#退出程序
print
(
"欢迎来到贝尔编程!"
)
print
(
"欢迎来到贝尔编程!"
)
#continue跳出本次循环
...
...
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