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
Switch branch/tag
  • lesson3-1-1_DIY1
  • diy2022.10.14.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 030d424c
    BellCodeEditor committed 2 years ago
    030d424c
diy2022.10.14.py 1.06 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
import turtle
pen = turtle.Pen()
screen = turtle.Screen()
screen.bgcolor("light blue")
len =int(screen.textinput("提示1","你想要多大的花啊,\n注:太大会超出屏幕的!"))
n =int(screen.textinput("提示2","你想要几个花瓣,\n注:太大会超出屏幕的!"))
pen.penup()
pen.goto(60,-120)
pen.write("你好啊,诺一,\n最近吃胖没有啊",font=("Times",20,"normal"))
pen.hideturtle()

pen.goto(-100,0)
pen.pendown()
pen.speed(100)

# len=100
# n=12
pen.fillcolor("red")
pen.begin_fill()
for i in range(n):
    pen.forward(len)
    pen.left(360/n)
pen.end_fill()
for i in range(n):
    pen.right(90)
    pen.circle(len/2,180) #第一个参数是画出圆的半径 第二参数是画出圆的角度,这是决定是圆还是半圆还是扇形
    pen.right(90)
    pen.left(360/n)

turtle.done()



# pen.fillcolor("red") # 设置填充的颜色

# pen.begin_fill()  # 开始填充
# for i in range(130):  #重复执行五次,让画笔移动200,右转144度
#     pen.forward(200)
#     pen.right(166)
# pen.end_fill()  # 结束填充