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
ffbd1058
authored
Feb 25, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2c29f121
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
190 additions
and
21 deletions
diy1.py
hhh.py
jntm.py
diy1.py
View file @
ffbd1058
# 利用write()帮助悟空给诺依回信吧~
username
=
"123"
import
turtle
userpassword
=
"123456"
screen
=
turtle
.
Screen
()
while
True
:
screen
.
bgcolor
(
"light green"
)
name
=
input
(
"请输入用户名"
)
pen
=
turtle
.
Pen
()
password
=
input
(
"请输入密码"
)
pen
.
penup
()
if
name
==
username
and
password
==
userpassword
:
pen
.
goto
(
-
100
,
0
)
print
(
"登陆成功"
)
pen
.
write
(
"诺依,turtle真好用,
\n
我会在画布上写字啦!"
,
break
font
=
(
"Times"
,
20
,
"normal"
))
if
name
!=
username
:
pen1
=
turtle
.
Pen
()
print
(
"用户名不存在,请重新输入!"
)
pen1
.
pensize
(
5
)
continue
pen1
.
pencolor
(
"red"
)
if
name
!=
userpassword
:
pen1
.
left
(
45
)
print
(
"密码输入有误,请重新输入!"
)
pen1
.
forward
(
100
)
print
(
"欢迎来到贝尔编程!"
)
pen1
.
circle
(
50
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
50
,
180
)
pen1
.
forward
(
100
)
pen1
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
hhh.py
0 → 100644
View file @
ffbd1058
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
i
,
'*'
,
j
,
'='
,(
i
*
j
),
end
=
' '
)
print
(
)
\ No newline at end of file
jntm.py
0 → 100644
View file @
ffbd1058
import
turtle
pen
=
turtle
.
Pen
()
color
=
[
"blue"
,
"red"
,
"orange"
,
"yellow"
]
for
sb
in
range
(
300
):
pen
.
forward
(
sb
)
pen
.
pencolor
(
color
[
sb
%
4
])
pen
.
right
(
91
)
pen
.
hideturtle
()
turtle
.
done
()
\ 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