I am trying to print the following pattern:
# #
## #
# # #
# ##
# #
I tried the following code:
for i in range(1,6):
for j in range(1,6):
if j==1 or j==5 or j==i:
print'*'
else:
print' '
print
But the output is:
*
*
*
*
*
*
*
*
*
*
*
*
I am new to Python.Please help me.