Question: Write a class named Tree which represents a tree species. This class tracks several properties associated with drawing the tree: its name, how long each

 Write a class named Tree which represents a tree species. This

Write a class named Tree which represents a tree species. This class tracks several properties associated with drawing the tree: its name, how long each branch section is, the colour of the branches, the colour of the leaves, and the angle at which branches diverge. You must complete the following functions in the Tree class: _init_o The init function should take as parameters all of the properties of the Tree defined in the file. Note that Python Turtle requires colours to be passed as a tuple of three values (r,g,b). __str_0 Consider the following code fragment: my_tree = Tree("Ash, 4, (150, 75,0), (0,255,0), 30) print(my_tree) The output should be: Ash __repr_0 Consider the following code fragment: C = Tree("Ash", 10, (5, 5, 5), (10, 10, 10), 30) print(repr(c)) The output should be: Tree("Ash", 10, (5, 5, 5), (10, 10, 10), 30)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!