Code
num = int(input("Enter the number of rows:"))
for i in range(0,num):
for j in range(0,num-i-1):
print(end="")
for j in range(0,i+1):
print("*",end="")
print()
Current output
*
**
***
****
*****
******
answer is not exactly the same as PYRAMID, show it in the picture
I think you want your pyramid to be centered and not leaning to the left side. For that, you have to adjust the spacing before and after the stars in your loops accordingly:
Changed Code
num = int(input("Enter the number of rows:"))
for i in range(0,num):
for j in range(0,num-i-1):
print(end=" ")
for j in range(0,i+1):
print("*",end=" ")
print()
Output
*
* *
* * *
* * * *
* * * * *
* * * * * *