python程序设计:画一个射箭运动所用的箭靶.从小到大分别黄,红,蓝,黑,白色的同

Python025

python程序设计:画一个射箭运动所用的箭靶.从小到大分别黄,红,蓝,黑,白色的同,第1张

from Tkinter import *

step=50

color=("white","black","blue","red","yellow")

canvas=Canvas(None,width=600,height=600)

canvas.pack()

for i in range(5,0,-1):

    canvas.create_oval(300-i*step,300-i*step,300+i*step,

                300+i*step,fill=color[-i],outline="orange")

mainloop()

python中四瓣花的填充颜色更改步骤:

1、首先,使用matplotlib.pyplot.subplots()函数创建一个子图,并设置其尺寸。

2、然后,使用matplotlib.pyplot.fill_between()函数绘制四瓣花,并设置其填充颜色。

3、最后,使用matplotlib.pyplot.show()函数显示图形。