Create a python program of this output.
Choices:
1 - Easy
2 - Medium
3 - Hard
Enter your choice: 3
Enter a number:5
*
* *
* * *
* * * *
* * * * *
Do you want to try again?: N
Thank you have a good day man!
print("Choices:")
print("1 - Easy")
print("2 - Medium")
print("3 - Hard")
choice=int(input("Enter your choice: "))
answer="y"
while answer.lower()=="y":
if choice==1:
pass
if choice==2:
pass
if choice==3:
number=int(input("Enter a number: "))
for i in range(0, number):
for j in range(0, number - i - 1):
print(end = ' ')
for k in range(0, i + 1):
print('*', end = ' ')
print()
answer=input("Do you want to try again?: ")
print("Thank you have a good day man!")
Comments
Leave a comment