Python画一颗豪华的圣诞树源代码

qqattend5989 14 0 py 2023-01-28 13:01:02

Python画一颗豪华的圣诞树源代码采用turtle库import turtle as t as就是取个别名后续调用的t都是turtle from turtle import import random as r import time n100.0speed fastest定义速度screensize bg black定义背景颜色可以自己换颜色left90forward3n color orange yellow定义最上端星星的颜色外圈是orange内部是yellow begin fill left126for i in range5画五角星forwardn5right144五角星的角度forwardn5left72继续换角度end fill right126def drawlight定义画彩灯的方法if r.randi

用户评论
请输入评论内容
评分:
暂无评论