I\'m supposed to write a program that ends up such as this:
* * * * * * *
I have the code written for a regular one, but I\'m not s
Try:
def triangle(i, t = 0): if i == 0: print (t+1) *' '+ '*' else: print ' ' * (t + 1)+ '*' + ' ' * (i * 2 - 1) + '*' triangle(i - 1, t + 1) triangle(5)
this code print:
* * * * * * * * * * *