Answer to Question #286889 in Python for Joseph

Question #286889

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!



1
Expert's answer
2022-01-12T05:07:49-0500


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!")

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