import turtle my_turtle turtle turtle(my_win turtle screen(def draw_spiral(my_turtleline_len)if linelen my_turtle forward(line_lenmy_turtle right( draw_spiral(my_turtleline_len draw_spiral(my_turtle my_win exitonclick(that is really about all the turtle graphics you need to know in order to make some pretty impressive drawings for our next program we are going to draw fractal tree fractals come from branch of mathematicsand have much in common with recursion the definition of fractal is that when you look at it the fractal has the same basic shape no matter how much you magnify it some examples from nature are the coastlines of continentssnowflakesmountainsand even trees or shrubs the fractal nature of many of these natural phenomenon makes it possible for programmers to generate very realistic looking scenery for computer generated movies in our next example we will generate fractal tree to understand how this is going to work it is helpful to think of how we might describe tree using fractal vocabulary remember that we said above that fractal is something that looks the same at all different levels of magnification if we translate this to trees and shrubs we might say that even small twig has the same shape and characteristics as whole tree using this idea we could say that tree is trunkwith smaller tree going off to the right and another smaller tree going off to the left if you think of this definition recursively it means that we will apply the recursive definition of tree to both of the smaller left and right trees lets translate this idea to some python code the code below shows how we can use our turtle to generate fractal tree lets look at the code bit more closely you will see that on lines and we are making recursive call on line we make the recursive call right after the turtle turns to the right by degreesthis is the right tree mentioned above then in line the turtle makes another recursive callbut this time after turning left by degrees the reason the turtle must turn left by degrees is that it needs to undo the original degree turn to the right and then do an additional degree turn to the left in order to draw the left tree also notice that each time we make recursive call to tree we subtract some amount from the branchlen parameterthis is to make sure that the recursive trees get smaller and smaller you should also recognize the initial if statement on line as check for the base case of branchlen getting too small def tree(branch_lent)if branch_len forward(branch_lent right( tree(branch_len recursion