Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-2_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
b41ebe2c
authored
Jul 23, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
217acd8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
34 deletions
diy1.py
diy1.py
View file @
b41ebe2c
#利用write()帮助悟空给诺依回信吧~
#
利用write()帮助悟空给诺依回信吧~
import
turtle
# pen=turtle.Pen()
# pen.write("你好呀",font=("Times",20,"normal"))
# pen.hideturtle()
# turtle.done()
p
=
turtle
.
Pen
()
p
.
color
(
"black"
,
"green"
)
p
.
begin_fill
()
p
.
left
(
45
)
p
.
forward
(
100
)
p
.
circle
(
50
,
180
)
p
.
right
(
90
)
p
.
circle
(
50
,
180
)
p
.
forward
(
100
)
p
.
end_fill
()
pen
=
turtle
.
Pen
()
g
pen
.
write
(
"你好呀"
,
font
=
(
"Times"
,
20
,
"normal"
))
pen
.
hideturtle
()
turtle
.
done
()
# import time
# words = input('Please input the words you want to say!:')
# #例子:words = "Dear lili, Happy Valentine's Day! Lyon Will Always Love You Till The End! ♥ Forever! ♥"
# for item in words.split():
# #要想实现打印出字符间的空格效果,此处添加:item = item+' '
# letterlist = []#letterlist是所有打印字符的总list,里面包含y条子列表list_X
# for y in range(12, -12, -1):
# list_X = []#list_X是X轴上的打印字符列表,里面装着一个String类的letters
# letters = ''#letters即为list_X内的字符串,实际是本行要打印的所有字符
# for x in range(-30, 30):#*是乘法,**是幂次方
# expression = ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3
# if expression <= 0:
# letters += item[(x-y) % len(item)]
# else:
# letters += ' '
# list_X.append(letters)
# letterlist += list_X
# print('\n'.join(letterlist))
# time.sleep(1.5);
p
=
turtle
.
Pen
()
\ 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