Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Triangles")
- height=int(input("Enter height:"))
- character=input("Enter character:")
- print('1) 2) 3) 4) 5) 6)')
- print('* * * ***** *** ***')
- print('** ** *** *** ** **')
- print('*** *** ***** * * *')
- shape=input("Enter shape number (select from schemes above):")
- for i in range(height+1):
- if shape == ('1' or '1)'):
- print(i * character)
- elif shape == ('2' or '2)'):
- print((height - i) * ' ' + i * character)
- elif shape == ('3' or '3)'):
- print((height-i) * ' ' + (2*i+1) * character)
- elif shape == ('4' or '4)'):
- print(i * ' ' + ((height-i)*2-1) * character)
- elif shape == ('5' or '5)'):
- print((height-i)*character)
- elif shape == ('6' or '6)'):
- print(i * ' ' + (height-i)*character)
- else:
- print("wrong entry for shape type")
Advertisement
Add Comment
Please, Sign In to add comment