so I'm trying to get my nested loop to display an image like in this picture:
So far, this is the code that I have.
for a in range (1):
print("#""#")
for b in range (0,5,1):
print("#", end=" ")
for c in range(b):
print(" ", end=" ")
print("#")
I'm new to the site, so please excuse my terrible formatting. The output I'm getting seems to have an extra space per line compared to the image given, and I'm not sure how to get rid of the space. I'd appreciate any help!
I'm thinking it's the 'end=' '' statement, but if I try replacing that with just a space, my entire line goes wonky.
Thanks!
end=“ “
do?’’
, i.e. nothing, which will suppress the newline.