ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

实验8

2022-06-13 22:31:24  阅读:48  来源: 互联网

标签:turtle 10 angle range 实验 __ size


1

 1 from turtle import *
 2 
 3 def square(size=50, rgb='orange'):
 4     pencolor(rgb)
 5     for i in range(4):
 6         fd(size)
 7         left(90)
 8 
 9 def main():
10     setup(800,600)
11     speed(0)
12 
13     n=10
14     for i in range (n):
15         square(80)
16         left(360/n)
17 
18     hideturtle()
19     done()
20 
21 if __name__=='__main__':
22 
23     main()

 

 

2

from turtle import*

setup(800,600)
pencolor('pink')
speed(0)

n=10

for i in range(n):

    for j in range (2):
        circle(80,90)
        left(90)
    right(360/n)

hideturtle()
done()

 

3

from turtle import *

setup(800, 600)
bgcolor('black')
pencolor('white')
speed(0)

angle = 0
size = 2

n = 10
for i in range(n):
    for j in range(4):
        fd(size)
        angle += 72
        seth(angle)
        size += 5
hideturtle()
done()

 

 

4

from turtle import *

setup(800, 600)
bgcolor('black')
pencolor('white')
speed(0)

angle = 0
size = 2

n = 10
for i in range(n):
    for j in range(4):
        fd(size)
        angle += 72
        seth(angle)
        size += 5
hideturtle()
done()

 

标签:turtle,10,angle,range,实验,__,size
来源: https://www.cnblogs.com/xhj060/p/16372543.html

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有