1.方法一: 代码: #python3.8 #xuguojun #2020.1.30 #导出模块 import turtle as t import random as r #定义画雪 def drawsnow(): t.ht() #隐藏笔头,ht=hideturtle t.pensize(2) #定义笔头大小 for i in range(50): #50,其实画49朵雪花 t.pencolor("white") #定义画笔颜色为白色,其实就是雪花为白色 t.pu() #提笔,pu=…
最早见过手写的,类似于下面这种: 1 import datetime 2 3 def time_1(): 4 begin = datetime.datetime.now() 5 sum = 0 6 for i in xrange(10000000): 7 sum = sum + i 8 end = datetime.datetime.now() 9 return end-begin 10 11 print time_1() 输出如下: ➜ Python python time_1.py 0:00…