Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-1-1_DIY1
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
018de7c7
authored
Mar 14, 2026
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d11a0656
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
diy1.py
diy1.py
View file @
018de7c7
# 利用write()帮助悟空给诺依回信吧~
i
=
5
import
turtle
usernamer
=
"sb"
screen
=
turtle
.
Screen
()
userpasddsword
=
"123456789"
screen
.
bgcolor
(
"light blue"
)
while
True
:
len
=
screen
.
textinput
(
"100"
,
"100"
)
if
i
>
0
:
len
=
int
(
len
)
name
=
input
(
"请输入用户名:"
)
pen
=
turtle
.
Pen
()
password
=
input
(
"请输入密码:"
)
pen
.
write
(
"你好
\n
SB."
,
font
=
(
"Times"
,
30
,
"normal"
))
i
-=
1
pen
.
hideturtle
()
if
usernamer
==
name
and
userpassword
==
password
:
len
=
60
print
(
"登录成功"
)
pen
.
penup
()
break
pen
.
goto
(
100
,
100
)
if
nime
!=
usernamer
:
pen
.
pendown
()
print
(
"用户名不正确请重新输入"
)
pen
.
pensize
(
5
)
continue
pen
.
pencolor
(
"red"
)
if
password
!=
userpassword
:
pen
.
left
(
45
)
continue
pen
.
forward
(
2
*
len
)
print
(
"密码不正确请重新输入"
)
pen
.
circle
(
len
,
180
)
else
:
pen
.
right
(
90
)
print
(
"你的账号已锁定,请带身份到我公司解锁"
)
pen
.
circle
(
len
,
180
)
print
(
"欢迎来到贝尔编星球"
)
pen
.
forward
(
2
*
len
)
turtle
.
done
()
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