Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_2
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
150684bc
authored
Apr 02, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
124c28ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
32 deletions
1234.py
diy2.py
1234.py
View file @
150684bc
import
turtle
i
=
5
pen
.=
turtle
.
pen
()
.
z
=
"1"
d
=
1.
m
=
"2"
for
i
in
rarie
(
3
,
0
):
while
True
:
pen
.
forward
(
d
)
if
i
>
0
:
pen
.
light
z1
=
input
(
"请输入账号:"
)
d
+
=
1
m1
=
input
(
"请输入密码:"
)
turtle
.
done
()
i
-=
1
if
z
==
z1
and
m
==
m1
:
print
(
"登录成功"
)
break
if
z
!=
z1
:
print
(
"账号错误"
)
print
(
"你还剩"
+
str
(
i
)
+
"次机会"
)
continue
if
m
!=
m1
:
print
(
"密码错误"
)
print
(
"你还剩"
+
str
(
i
)
+
"次机会"
)
continue
else
:
print
(
"账号锁定"
)
exit
()
print
(
"欢迎来到未来世界"
)
\ No newline at end of file
diy2.py
View file @
150684bc
z
=
"1"
import
turtle
m
=
"2"
turtle
.
screensize
(
bg
=
"black"
)
i
=
3
pen
=
turtle
.
Pen
()
while
True
:
yan
=
[
"red"
,
"orange"
,
"yellow"
,
"green"
]
if
i
>
0
:
for
i
in
range
(
1
,
300
,
1
):
z1
=
input
(
"请输入账号:"
)
pen
.
pencolor
(
yan
[
i
%
4
])
m1
=
input
(
"请输入密码:"
)
pen
.
forward
(
i
)
i
=
i
-
1
pen
.
left
(
91
)
if
z
==
z1
and
m
==
m1
:
turtle
.
done
()
print
(
"登录成功"
)
\ No newline at end of file
break
if
z
!=
z1
:
print
(
"账号错误"
)
print
(
"你还有"
+
str
(
i
)
+
"次机会"
)
continue
if
m
!=
m1
:
print
(
"密码错误"
)
print
(
"你还有"
+
str
(
i
)
+
"次机会"
)
continue
else
:
print
(
"你的账号已锁定一辈子"
)
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