Feb-05-2019, 09:50 AM
I would like to be able to push each | into an array
Here is my function:
expected input:
Here is my function:
def pyramide(lines): k = 1 * lines - 1 for i in range(0, lines): for j in range(0, k): print(end=" ") k = k - 1 for j in range(0, i+1): print("|", end=" ") print("\r") lines = 5 pyramide(lines)What I tried:
for j in range(0, i+1): each = print("|", end=" ") array.push(each) print("\r")But it doesn't seem to add it into an array, my question is how I can push each | into an array so I can delete it later
expected input:
pyramide(5)expected output:
| | | | | | | | | |Then I should be able to remove a | from each line by
stickDelete(3, 2) # first paramater is the line, second is how much | would like to delete | | | | | | |Thanks for reading.