Program 5
Use a for loop to print a triangle like the one below. Allow the user to specify how high the triangle should be.
*
**
***
****
Program:
height=int(input("Enter the height of the Triangle:"))
for i in range(1,height+1):
for j in range(i):
print("*",end="")
print("")
Output:
Enter the height of the Triangle:6
*
**
***
****
*****
******
No comments:
Post a Comment