Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson3-1-1_DIY1

  • This project
    • Loading...
  • Sign in
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 88b691da authored 2 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

auto save

parent d2020fac
Hide whitespace changes
Inline Side-by-side
Showing with 8 additions and 4 deletions
  • diy.py
diy.py
View file @ 88b691da
......@@ -13,13 +13,16 @@ pen.hideturtle() # 调用hideturtle()方法隐藏画笔
pen1 = turtle.Pen() # 新建画笔Pen1
pen1.pencolor("red") # 设置线条的颜色
pen1.pensize(5) # 设置线条的粗细
# 调用textinput()创建参1标题,参2提示,并赋值给变量len
len = screen.textinput("提示", "你想要多大的爱心呀?")
lovesize = int(len) # 用int()转化变量len,并赋值给变量lovesize
# 借助变量
len = 40 # 用len表示圆的半径
pen1.left(45) # 左转45
pen1.forward(2*len) # 向前2*len
pen1.circle(len,180) # 画出半圆len,180
pen1.forward(2*lovesize) # 向前2*len
pen1.circle(lovesize,180) # 画出半圆len,180
pen1.right(90) # 右转90
pen1.circle(len,180) # 画出半圆50,180
pen1.forward(2*len) # 向前100
pen1.circle(lovesize,180) # 画出半圆len,180
pen1.forward(2*lovesize) # 向前2*len
pen1.hideturtle() # 隐藏画笔
turtle.done() # 保存画布
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment