Skip to content

Instantly share code, notes, and snippets.

@gilrg18
Created March 24, 2015 18:24
Show Gist options
  • Save gilrg18/31ae5c602f02f0cbf4ef to your computer and use it in GitHub Desktop.
Save gilrg18/31ae5c602f02f0cbf4ef to your computer and use it in GitHub Desktop.
Triangles
#Gilberto Rogel García A01630171
def triangles(size):
for r in range(1,size+1):
for c in range(1,r+1):
print("t", end="")
print()
for r in range(size-1,0,-1):
for c in range(1,r+1):
print("t",end="")
print()
print("This program makes a triangle using your number as the middle length")
size=int(input("Give me a number:"))
t=triangles(size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment