day03

1.简述变量的组成

  1. 变量名:用来引用变量值,但凡需要用变量值,都要通过变量名
  2. 赋值符号:赋值
  3. 变量值:存放数据,用来记录显示世界中的某种状态

2.简述变量名的命名规范

  1. 变量的命名应该能反映变量值所描述的状态,切记不可用中文
  2. 变量名必须用字母数字下划线组合,并且变量名的第一个字符不能是数字
  3. 关键字不能声明为变量名

3.简述注释的作用

增加代码的可读性,让别人和自己都看得懂

4.使用turtle库构造一副图,贴在markdown文档中

这是啥

import turtle
#第一个园
turtle.setup(400,400,100,200)
# turtle.speed(0.5)
turtle.penup()
turtle.goto(0,40)
turtle.pendown()
turtle.circle(70,360)

#第二个园
turtle.penup()
turtle.goto(0,100)
turtle.pendown()
turtle.fillcolor('red')
turtle.begin_fill()
turtle.circle(10,360)
turtle.end_fill()

#第一个扇叶
turtle.seth(-150)
turtle.fillcolor('green')
turtle.begin_fill()
turtle.circle(50,70)
turtle.seth(30)
turtle.circle(50,70)
turtle.end_fill()

#第二个扇叶
turtle.penup()
turtle.goto(5,120)
turtle.seth(45)
turtle.pendown()
turtle.fillcolor('green')
turtle.begin_fill()
turtle.circle(50,70)
turtle.seth(-135)
turtle.circle(50,70)
turtle.end_fill()

#底座
turtle.penup()
turtle.goto(0,40)
turtle.pendown()
turtle.seth(-90)
turtle.left(20)
turtle.fd(100)
turtle.penup()
turtle.goto(0,40)
turtle.pendown()
turtle.seth(-90)
turtle.right(20)
turtle.fd(100)
turtle.seth(0)
turtle.fd(75)

#还有一个园
turtle.penup()
turtle.goto(0,-40)
turtle.pendown()
turtle.fillcolor('red')
turtle.begin_fill()
turtle.circle(10,360)
turtle.end_fill()
turtle.done()


转载于:https://www.cnblogs.com/zqfzqf/p/11400864.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值