right angle triangle in python

for i in range(0,x+1):
    print(" "*(x-i),end="")
    for j in range(0+i):
        print("#",end="")
    print()
    
    
   #
  ##
 ###
####

Here is what the above code is Doing:
1. We are creating a nested loop. The outer loop is for the rows and the inner loop is for the columns.
2. We are using the range function to specify the number of rows.
3. We are using the print function to print the spaces and the hashes.
4. We are using the end=”” parameter to print the spaces and the hashes on the same line.
5. We are using the x variable to specify the number of rows.
6. We are using the x-i variable to print the spaces.
7. We are using the 0+i variable to print the hashes.
8. We are using the print function to print a new line after each row.