Replace this...:
steps=6
for r in range(steps):
for c in range(r):
print(' ', end='')
print('#')
With this:
steps=6
for r in range(steps):
print('#', end='')
for c in range(r):
print(' ', end='')
print('#')
Which outputs:
##
# #
# #
# #
# #
# #
It's just a simple mistake in the program logic.
However, it is still better to do this:
steps=6
for r in range(steps):
print('#' + (' ' * r) + '#')
To avoid complications like this happening when using nested for
loops, you can just use operators on the strings.