Hello
I would like to ask how to write a python program which looks like this
|
| * |
| * | * |
| * | * |
| * |
|
The input for this program is 3, the user would input the number and it would print accordingly
#take input
n=int(input())
#print "|" the nummber of whitespace will be n-1
print(" "*(n-1),"|")
#print sequence of "|*|" ,number of whitespace will be n-i
for i in range(2,n+1):
print(" "*(n-i),"|*|"*(i-1))
#repeat the above process in reverse order
for i in range(n,1,-1):
print(" "*(n-i),"|*|"*(i-1))
print(" "*(n-1),"|")


Hello I would like to ask how to write a python program which looks like this...