I made this code which outputs
.
...
.....
...*****.
....***...
.....*.....
but its supposed to output
.
...
.....
.*****.
...***...
.....*.....
Any ideas what im doing wrong?
To output the triangle
myChar1 = *
myChar2 = .
myLen = 3
myChar1 = input("Select first character: ")
myChar2 = input("Select Second character: ")
myLen = int(input("Length of first segment: "))
def triangle1(mylen):
for i in range(mylen, 0, -1):
print('.'*(mylen-i+3) + myChar1*(2*i-1) + '.'*(mylen-i*2+4))
def triangle2(mylen):
for i in range(mylen):
print(' '*(mylen-i+2) + myChar2*(2*i-1))
triangle2(4), triangle1(3)