我想讓用戶輸入一個顏色名稱來設置烏龜窗口的背景,這是一個繪圖程序,我忘了該怎麼做呢?烏龜繪圖背景改變raw_input python 2.7
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
我記得有加東西的元組的某種方式?就像某種會將廣告投放到()或什麼的東西那樣? – user2918250