Create a python program of this output.
Choices:
1 - Output 1
2 - Output 2
3 - Output 3
Enter your choice: 3
Enter a number:5
*
* *
* * *
* * * *
* * * * *
def print_tree(n:int): for i in range(n): print(" "*(n-i-1)+"* "*(i+1)) print("Choices:\n1 - Output 1\n2 - Output 2\n3 - Output 3\n") choise = input("Enter your choice: ") if choise == "3": n = int(input("Enter a number: ")) print_tree(n)
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments