最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

python 画画

IT圈 admin 2浏览 0评论

python 画画

奥运五环

import turtle
p = turtle
p.pensize(3)
# Blue ring
p.color('blue')
p.circle(30,360)
p.pu()
p.goto(60,0)
p.pd()
# Black ring
p.color('black')
p.circle(30,360)
p.pu()
p.goto(120,0)
p.pd()
# Red ring
p.color('red')
p.circle(30,360)
p.pu()
p.goto(90,-30)
p.pd()
# Green ring
p.color('green')
p.circle(30,360)
p.pu()
p.goto(30,-30)
p.pd()
# Yellow ring
p.color('yellow')
p.circle(30,360)
p.done()

菊花

import turtle
turtle.speed(100)
t = turtle.Pen()
t.color("gold")
t.pensize(7)
for x in range(12):t.shape("turtle")t.circle(100,360)t.left(30)
turtle.done()

python 画画

奥运五环

import turtle
p = turtle
p.pensize(3)
# Blue ring
p.color('blue')
p.circle(30,360)
p.pu()
p.goto(60,0)
p.pd()
# Black ring
p.color('black')
p.circle(30,360)
p.pu()
p.goto(120,0)
p.pd()
# Red ring
p.color('red')
p.circle(30,360)
p.pu()
p.goto(90,-30)
p.pd()
# Green ring
p.color('green')
p.circle(30,360)
p.pu()
p.goto(30,-30)
p.pd()
# Yellow ring
p.color('yellow')
p.circle(30,360)
p.done()

菊花

import turtle
turtle.speed(100)
t = turtle.Pen()
t.color("gold")
t.pensize(7)
for x in range(12):t.shape("turtle")t.circle(100,360)t.left(30)
turtle.done()

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论