Question: goal: Learn to write recursive functions with a base case. ( python ) Assignment: Write a function print _ tree that takes an int parameter.

goal: Learn to write recursive functions with a base case. (python)
Assignment: Write a function print_tree that takes an int parameter. This parameter is the height of the tree to print. The tree's leaves should be asterisks and shaped as a triangle facing up. At the base of the triangle, the tree should have a stem with a height of 1 if the tree is less than 10 high, and a height of 2 otherwise, represented by the character "]". If the height is not a positive number, it should print nothing.
You can at most use one other function to achieve this, which should be named _print_tree. You have to use recursion to complete this assignment.

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!