【发布时间】:2023-03-13 16:57:02
【问题描述】:
我正在尝试绘制南瓜灯,但我不知道如何应用我定义的这些参数...有什么函数可以让我绘制我创建的随机形状?
from turtle import*
pumpkin_size=input("Would you like your pumpkin to be tall, fat, or small? ")
turtle_1=Turtle()
turtle_2=Turtle()
def tall_pumpkin():
color("orange")
shape("circle")
shapesize(20,16,5)
fillcolor("orange")
def fat_pumpkin():
color("orange")
shape("circle")
shapesize(15,18,5)
def small_pumpkin():
color("orange")
shape("circle")
shapesize(14,14,5)
interpret_size = {
"fat": "fat_pumpkin",
"tall": "tall_pumpkin",
"small": "small_pumpkin",
}
exitonclick()
【问题讨论】:
标签: python python-3.x turtle-graphics