-1

This is my code so far but it only makes on half of the mountain image out of the *'s I'm trying to go for

How do I mirror the code or change it so that it creates that same mountain side, but on the left side as well?

It should look something like this: /\

size = 5

for row in range(0, size+5):
    for columnSpc in range(size+row):
        print('*', end='')

for columnStar in range(row+row):
    print('*', end='')

print()
Daniel Lee
  • 7,189
  • 2
  • 26
  • 44
A.M
  • 11

1 Answers1

0

are you looking for something like this?

size = 5

for row in range(1, size+1):
    for space in range(size-row+1, 0, -1):
        print(' ',end='')
    for star in range(1,row*2):
        print('*',end='')
    print()

Output:

     *
    ***
   *****
  *******
 *********
Bhavesh Ghodasara
  • 1,981
  • 2
  • 15
  • 29