- 博客(9)
- 收藏
- 关注
原创 案例问题:为什么会有None?求高手!
#装饰器import timedef decorate(func):def wrapper(n):print(‘正在校验中…’)time.sleep(1)func(n)print(‘校验完毕…’)return wrapper@decoratedef f1(n):print(’----f1----’,n)@decoratedef f2(x):print(’----f2--...
2020-03-13 15:35:56
310
原创 五角星
import turtleimport timeturtle.pensize(5)turtle.pencolor(“yellow”)turtle.fillcolor(“red”)turtle.begin_fill()for _ in range(5):turtle.forward(200)turtle.right(144)turtle.end_fill()time.sleep(...
2020-03-11 15:29:59
403
原创 turtle绘制小蟒蛇
import turtledef drawSnake(rad, angle, len, neckrad):for _ in range(len):turtle.circle(rad, angle)turtle.circle(-rad, angle)turtle.circle(rad, angle/2)turtle.forward(rad/2) # 直线前进turtle.circle...
2020-03-11 15:27:42
346
原创 python乌龟吃鱼
‘’’1.首先要有一个画布2.随机乌龟和鱼的位置3.移动‘’’import random as rlist_x = [0,10]list_y = [0,10]class Turtle:def init(self):#初始体力self.power=100#初始位置self.x = r.randint(list_x[0],list_x[1]) # 这里重点知道 randint...
2020-03-11 14:09:27
544
原创 2020-03-10
文科生45岁学编程,只为兴趣,给自己加油!!!93年上中专前沒碰过电脑,第一次学basic语言始终听不懂,为什么:x=x+1?..现在重新拾起!!!!
2020-03-10 18:26:45
85
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人