Little update:
I think this is the cloest to my goal:
def print_spruce(n): for i in range(1, n+1): print (" " *(n-i) + "X"*(2*i-1)) print (" " * (n-1) + "X") n = int(input("Write the size of the spruce:")) print_spruce(n)terminal:
Write the size of the spruce:5 X X XXX X XXXXX X XXXXXXX X XXXXXXXXX XSo, what should I change?
I think this is the cloest to my goal:
def print_spruce(n): for i in range(1, n+1, 2): print (" " *(n-i) + "X"*(2*i-1)) print (" " * (n-1) + "X") n = int(input("Write the size of the spruce:")) print_spruce(n+1)terminal:
Write the size of the spruce:5 X X XXXXX X XXXXXXXXX XSo, where are the mistakes?