python : turtle 画奥运五环

draw_5rings.py

from turtle import *

colors=['blue','black','red','yellow','green']
for i in range(5):
x = -100+100*i if i<3 else 50*(-1)**i
y = 50 if i<3 else 0
up(),goto(x,y),width(5),down()
color(colors[i])
circle(40)
#
color('black')
up(),goto(-80,-80),down()
write("the Olympic Rings",font=("Aril",16,'bold'))
done()
展开阅读全文

没有更多推荐了,返回首页