sc = []
n = 6
for i in range(n):
sc.append("#")
scstr = ''.join(map(str, sc))
print(scstr)
I tried using the code below to cancel the output by adding white spaces, but it prints a distorted ladder.
# print(scstr.rjust(n-i, ' ')) -- trying to print reversed staircase
Please help convert the right-aligned staircase to LEFT ALIGNED consisting of # characters and spaces.
A visual description of the expected exit is included.

source
share