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
b8e5c50c
authored
Jul 23, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a996c639
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
13 deletions
1.py
diy.py
diy1.py
1.py
0 → 100644
View file @
b8e5c50c
i
=
3
username
=
"python"
userpassword
=
"123456"
while
True
:
if
i
>
0
:
name
=
input
(
"请输入您的帐号:"
)
password
=
input
(
"请输入您的密码:"
)
i
-=
1
if
name
==
username
and
password
==
userpassword
:
print
(
"登录成功!"
)
break
if
name
!=
username
:
print
(
"不存在"
)
continue
if
password
!=
userpassword
:
print
(
"有误"
)
else
:
print
(
"密码yoyo"
)
exit
()
print
(
"欢迎"
)
\ No newline at end of file
diy.py
0 → 100644
View file @
b8e5c50c
dict_hero
=
{
"猴三"
:
10
,
"猴一"
:
21
,
"猴五"
:
22
,
"猴队长"
:
29
,
"猴七"
:
30
}
print
(
dict_hero
)
print
(
dict_hero
[
"猴队长"
])
dict_hero
[
"猴七"
]
=
32
print
(
dict_hero
)
dict_hero
[
"猴十"
]
=
25
print
(
dict_hero
)
\ No newline at end of file
diy1.py
View file @
b8e5c50c
i
=
3
username
=
"python"
username
=
"python"
userpassword
=
"123456"
userpassword
=
"123456"
while
True
:
while
True
:
name
=
input
(
"请输入您的帐号:"
)
if
i
>
0
:
password
=
input
(
"请输入您的密码:"
)
name
=
input
(
"请输入您的帐号:"
)
if
name
==
username
and
password
==
userpassword
:
password
=
input
(
"请输入您的密码:"
)
print
(
"登录成功!"
)
i
-=
1
break
if
name
==
username
and
password
==
userpassword
:
if
name
!=
username
:
print
(
"登录成功!"
)
print
(
"不存在"
)
break
if
password
!=
userpassword
:
if
name
!=
username
:
print
(
"有误"
)
print
(
"不存在"
)
print
(
"错误"
)
continue
print
(
"欢迎"
)
if
password
!=
userpassword
:
\ No newline at end of file
print
(
"有误"
)
else
:
print
(
"密码yoyo"
)
exit
()
print
(
"欢迎"
)
\ 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