zoukankan      html  css  js  c++  java
  • 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()
    
    
    
    
  • 相关阅读:
    开源资源大汇总(C#)
    javascript必知必会之this关键字及scope(转)
    MSMQ 消息队列 安装MSMQ 创建发送接收队例消息
    精确获取页面元素的位置(转)
    javascript无缝滚动(转)
    C#多线程
    javascript十个最常用的自定义函数(转)
    ASP.NET——ASP.NET 数据库缓存依赖
    jQuery三维展示插件(转)
    Action和Func的区别
  • 原文地址:https://www.cnblogs.com/zqfzqf/p/11400864.html
Copyright © 2011-2022 走看看