码迷,mamicode.com
首页 > 其他好文 > 详细

实验六

时间:2021-06-18 20:00:08      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:info   main   def   got   mamicode   set   inf   load   ora   

from turtle import *
def moveto(x,y):
penup()
goto(x,y)
pendown()
def main():
setup(800, 600)
speed(0)
for radius in range(20, 200, 20):
moveto(0, -radius)
circle(radius)
hideturtle()
done()
if __name__ == ‘__main__‘:
main()

技术图片

 

from turtle import *
def moveto(x,y):
penup()
goto(x,y)
pendown()
def main():
setup(800, 600)
speed(0)
for radius in range(180, 0, -20):
moveto(0, -radius)
circle(radius)
hideturtle()
done()
if __name__ == ‘__main__‘:
main()

 

 

技术图片

 

from turtle import *
from random import random
def moveto(x,y):
penup()
goto(x,y)
pendown()
def main():
setup(800, 600)
speed(0)
for radius in range(180, 0, -20):
moveto(0, -radius)
rgb = tuple(random() for i in range(3))
begin_fill()
circle(radius)
end_fill()
hideturtle()
done()
if __name__ == ‘__main__‘:
main()

 

技术图片

 

from turtle import *
def square(size=50, rgb = ‘orange‘):
pencolor(rgb)
for i in range(4):
fd(size)
left(90)
def main():
setup(800, 600)
speed(0)
for i in range(6):
square(80)
left(60)
hideturtle()
done()
if __name__ == ‘__main__‘:
main()

技术图片

 

from turtle import *
setup(800, 600)
pencolor(‘pink‘)
for i in range(4):
for i in range(5):
circle(80, 90)
left(90)
circle(80,90)
right(90)
hideturtle()
done()

技术图片

 

from turtle import *
speed(0)
setup(800, 600)
bgcolor(‘black‘)
pencolor(‘white‘)
angle = 0
size = 2
for i in range(10):
for j in range(4):
fd(size)
angle += 91
seth(angle)
size += 5
hideturtle()
done()

技术图片

 

实验六

标签:info   main   def   got   mamicode   set   inf   load   ora   

原文地址:https://www.cnblogs.com/gjxy/p/14899169.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!