8.23 作业

1.简述变量的组成

会变化的量(状态--》描述某件事物的属性)

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

变量名 赋值符号 (=)变量值

name='lidandan' #人的姓名

print(name)

a.变量名必须得具有意义

b.变量名以字母,数字,下划线组成,不能用数字开头

c.不能以关键字命名

3.简述注释的作用

a.单行注释,让后面的代码失效,解释器不解释该代码,就是普通的字符

b.代码行最后注释,就是解释前面的代码

c.多行注释用三单引号或者三双引号

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

1776502-20190823162337884-1038041881.png

import turtle
turtle.setup(800,600)
#O
turtle.pensize(5)
turtle.pencolor("red")
turtle.pu()
turtle.bk(200)
turtle.pd()
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(50,360)
turtle.end_fill()

#L
turtle.pu()
turtle.fd(65)
turtle.seth(90)
turtle.fd(100)
turtle.pd()
turtle.left(180)
turtle.fd(100)
turtle.left(90)
turtle.fd(70)

#D
turtle.pu()
turtle.fd(15)
turtle.seth(90)
turtle.fd(100)
turtle.pd()
turtle.left(180)
turtle.fd(100)
turtle.left(90)
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(50,180)
turtle.end_fill()


#B
turtle.pu()
turtle.bk(65)
turtle.pd()
turtle.left(90)
turtle.fd(100)
turtle.left(90)
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(25,180)
turtle.end_fill()
turtle.right(180)
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(25,180)
turtle.end_fill()

#O
turtle.pu()
turtle.bk(100)
turtle.pd()
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(50,360)
turtle.end_fill()

#Y
turtle.pu()
turtle.bk(65)
turtle.pd()
turtle.seth(315)
turtle.fd(50)
turtle.seth(45)
turtle.fd(50)
turtle.pu()
turtle.bk(50)
turtle.pd()
turtle.seth(270)
turtle.fd(65)

turtle.done()

5.pycharm个性化设置

file --》 settings --》 editor --》general --》 change font size ···

file --》 settings --》 editor --》font --》 修改默认字体大小

file --》 settings --》 editor --》color Scheme --》 python --》monokai (背景颜色的配置)

file --》 settings --》 editor --》 general --》 code completion --》case sensitive completion --》 None

6.pycharm的快捷键

ctrl + v 粘贴

ctrl + c 复制

ctrl + a 全选

ctrl + x 剪切

ctrl + y 删除整行

ctrl + backspace 删除一个单词

shift + enter 换行

ctrl + f 搜索 --》 match case 匹配大小写;words 匹配单词(以空格区分单词)

ctrl + d 向下复制

ctrl + shift + r 全局搜索

shift + F10 运行上一次运行的文件

ctrl + shift + f10 运行当前文件

home 行首

crtl + home 行首

end 行尾

ctrl + end 文件尾

file --》settings --》 keymap --》

百度pycharm快捷键大全

转载于:https://www.cnblogs.com/lidandanaa/p/11400825.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值