Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_3
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
c08f1189
authored
Nov 14, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4a7cb6b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
P1114.py
P1114.py
0 → 100644
View file @
c08f1189
#保存在数据库中的用户正确的用户名和密码
usename
=
"python"
password
=
"123456"
#用户名和密码的输入与判断
while
True
:
#1、用input提示用户输入用户名和密码,分别保存在us变量和ps变量中
us
=
input
(
"请输入您的用户名:"
)
ps
=
input
(
"请输入您的密码:"
)
#2、如果用户名和密码正确,输出登陆成功
if
(
us
==
usename
)
and
(
ps
==
password
)
:
print
(
"用户名、密码正确,登陆成功!"
)
#3、如果用户名、密码输入不正确,提示重新输入
if
us
!=
usename
:
print
(
"用户名不正确,请重新输入!"
)
if
ps
!=
password
:
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