СРОЧНО, ПАЙТО!!!! ЧЕРЕПАШКА

Приложения:

Clock4323: Я сейчас это же задание делаю 0_0

Ответы

Ответ дал: Clock4323
1

# Python Program to draw a Y Fractal Tree in Turtle - Python  

from turtle import *  

 

speed('fastest')  

 

# Making the turtle facing upwards  

right(-90)  

 

# Using an acute angle btw  

# the base and the Y's branch  

angle = 30  

 

# method for plotting a Y  

def y(length, lvl):  

 

   if lvl > 0:  

         

       #altering the colour  

       #according to the current level  

       #by dividing the rgb range for green  

       #into equal intervals for each level.  

       pencolor('green')  

         

       # drawing the base  

       forward(length)  

 

       right(angle)  

 

       # calling recursion for  

       # the right subtree  

       y(0.8 * length, lvl-1)  

         

       pencolor('black')  

         

       left( 2 * angle )  

 

       # calling recursion for  

       # the left subtree  

       y(0.8 * length, lvl-1)  

         

       pencolor('green')  

         

       right(angle)  

       forward(-length)  

         

         

# Drawing the tree of length 40 and level 8  

y(40, 8)  

 

exitonclick()

hideturtle()  


av3411261: спасибо но это немного не то, нужно было как на рисунке(
Похожие вопросы