
Jiayu
少儿编程侯老师
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
jiayu -猜数字
# 猜数字:电脑出一个随机1-100数字,我们输入一个数字,判断是否猜中# 电脑出一个1-100的随机数字import randomcomputer = random.randint(1,100)for w in range(25):# 我们猜一个数字 we = input("猜一个数字") we = int(we) # 判断有没有猜中 if we =...原创 2020-02-07 14:47:56 · 209 阅读 · 0 评论 -
jiayu - 猜拳游戏
# 猜拳游戏"""石头1 布2 剪刀3赢:电脑 我们 结果1 2 -12 3 -13 1 2输:电脑 我们 结果1 3 -22 1 13 2 1平局:电脑 我们 结果1 1 02 2 03 3 0"""#...原创 2020-02-06 14:48:08 · 179 阅读 · 0 评论 -
jiayu -判断语句的用法和写法
# 坐高铁tickets = input("你有几张票呀") # 字符串tickets = int(tickets)# print(tickets)# 判断# 判断符号:> < == >= <= !=# 如果票大于0,就进站:if tickets > 0: print("请进站") booms = input("你带了几个炸弹...原创 2020-02-05 17:46:44 · 204 阅读 · 0 评论 -
jiayu-随机数字
import turtleimport randomwd=20nd=144turtle.speed(0)turtle.color("yellow")turtle.bgcolor("black")turtle.pensize(5)for y in range(100): # 跳转另一个地方 turtle.color(random.random(),random.ra...原创 2020-02-04 14:47:51 · 241 阅读 · 0 评论 -
jiayu -for循环
# 代码的精髓:解决重复劳动力# for循环# for 变量名 in 集合:# 需要重复执行的语句# 1-100:# 1+2+3+4+。。。。。100w=0for i in range(100000): w=w+iprint(w)import turtlewd=100nd=85turtle.speed(0)for w in range(1000):...原创 2020-02-03 14:45:53 · 338 阅读 · 0 评论 -
jiayu - 学习用变量画画
import turtle# 三基色 红绿蓝 光 r g b# 三原色 红黄蓝 颜料# turtle.color(250/255,124/255,129/255)# 红 绿 蓝turtle.pensize(1)turtle.speed(0)# fd 前景# 变量:可以理解为装数据的盒子# 变量名:# 1。由数字,字母,下划线 _ 组成的# 2。不能有标点符号,数字不能...原创 2020-02-02 14:36:21 · 162 阅读 · 0 评论 -
jiayu -turtle画画的各种功能
import turtle# 颜色 colorturtle.color('blue')# 宽度 width 笔的尺寸 pensizeturtle.width(8)# 形状 shapeturtle.shape('turtle')# 填充颜色 fillcolorturtle.fillcolor('yellow')# 告诉电脑开始填充 begin_fillturtle.begi...原创 2020-01-18 12:43:00 · 321 阅读 · 1 评论 -
jiayu - python的认识
import turtleturtle.fd(100)turtle.lt(120)turtle.fd(100)turtle.lt(120)turtle.fd(100)turtle.lt(120)原创 2020-01-12 18:52:27 · 173 阅读 · 0 评论