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
*
* *
* * *
* * * *
* * * * *
Do you want to try again?: N
Thank you have a good day!
while True:
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: "))
for i in range(n):
print(" "*(n-i-1)+"* "*(i+1))
com = input("Do you want to try again?(y/n): ")
if com.lower() == "y":
continue
if com.lower() == "n":
break
print("Thank you have a good day!")
Comments
Leave a comment