Created
August 19, 2015 21:51
-
-
Save Satshabad/e8e1c2a057f9a0967c49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=int(input("base")) | |
def triangle(n): | |
y=((n+(n-1))/2) | |
x=1 | |
while (x <= n): | |
if x%2==0: | |
print(" "*(y+1)+"* "*(x-1)+"*") | |
x=x+1 | |
y=y-1 | |
elif x%2!=0: | |
print(" "*y+" *"*(x-1)+" *") | |
x=x+1 | |
y=y-1 | |
triangle(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment