变量的组成
变量名:用来引用变量值,
赋值符号:赋值
变量值:存放数据
变量名的命名规范
- 具有一定的意义
- 只能有字母,下划线,数字组成,不能以数字开头
- 关键字不能作为变量名使用
注释的作用
- 使注释的代码不进行翻译
- 用来解释说明代码的信息与作用
turtle画图
import turtle
turtle.setup()
turtle.speed(8)
turtle.pensize(1)
n1 = 2
n2 = 2
turtle.seth(90)
for x in range(100):
n3 = n1 + n2
turtle.circle(n3, 90)
n1 = n2
n2 = n3
turtle.done()