Answer to Question #286508 in Python for Miggy

Question #286508

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

  * 

  * * 

 * * * 

 * * * * 

* * * * * 


1
Expert's answer
2022-01-11T09:44:28-0500
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?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS