a1. 同心圆

  1. 思考下面程序的执行结果,复制到thonny里执行。

    1. from turtle import *
    2. circle(100)
    3. circle(110)
    4. done()
  2. 修改程序,使用for语句,绘制10个圆

    以下代码没有使用循环

    1. from turtle import *
    2. circle(100)
    3. circle(110)
    4. circle(120)
    5. circle(130)
    6. circle(140)
    7. circle(150)
    8. circle(160)
    9. circle(170)
    10. circle(180)
    11. circle(190)
    12. done()

    听老师讲解修改程序。

  3. 思考给这10个圆填充颜色

    以下程序画里一个黄色到圆

    1. from turtle import *
    2. color('red', 'yellow')
    3. begin_fill()
    4. circle(100)
    5. end_fill()
    6. done()

    听老师讲解修改程序。

  4. 听老师讲解。如何绘制同心圆

a2. 绘制正方形

  1. 复制下面代码到thonny,执行并查看效果

    1. from turtle import *
    2. color('red', 'yellow')
    3. begin_fill()
    4. zhengfangxing()
    5. end_fill()
    6. done()

    听老师讲解,为什么有这样的结果。

  2. 复制下面代码到thonny,执行并查看效果

    1. from turtle import *
    2. color('red', 'yellow')
    3. begin_fill()
    4. for i in range(4):
    5. forward(50)
    6. left(90)
    7. end_fill()
    8. done()
  3. 让我们自己写一个正方形方法吧。

    听老师讲解,修改程序。

a3 自己写一个画圆程序,并且修改同心圆程序

听老师讲解,修改代码

a4 乌龟的坐标系统

  1. 听老师讲解下面的程序。
  1. from turtle import *
  2. position()
  3. forward(100)
  4. position()
  5. left(90)
  6. position()
  7. forward(100)
  8. position()
  9. left(90)
  10. forward(200)
  11. position()
  12. setpos(-100,-100)
  1. 试一试,画布默认的尺寸是多少