我想让用户输入一个颜色名称来设置乌龟窗口的背景,这是一个绘图程序,我忘记了怎么做?
import turtle
wn = turtle.Screen()
color = raw_input('enter background color')
color ??????? wn.bgcolor('') # set the window background color
tess = turtle.Turtle()
tess.color("blue") # make tess blue
tess.pensize(3) # set the width of her pen
tess.forward(50)
tess.left(120)
tess.forward(50)
wn.exitonclick() # wait for a user click on the canvas