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
you should be using a for loop for this, recursion works but it is not the best idea to use it all the time. this is what i did:
def GioTri(i):
foo = i - 1
bar = 0
for i in range(i-1):
print ' ' * bar + "*" + " " * (foo*2 - 1) + "*" + " " * bar
foo = foo - 1
bar = bar + 1
print " " * bar + "*" + " " * bar
the result of this looks like this:
* *
* *
* *
*