2

Hello I cant find any tutorials online but I'm trying to make an hour glass in python but cant seem to figure it out. So this is the code I've been trying to get the bits and pieces first before putting it together.

def triangle(height):
    for x in range(height):
        print(" "*(height - x +1), end= "")
        print("/", end = "")
        for i in range():
            print(":")

        print(" "*x*2, end = "")

        print("\\", end = "")

        print(""*x)


triangle(7)


for numbang in range(-8):
    for i in range(numbang):
        print("!", end="")
    print()

for numbangs in range(8):
    for y in range(numbangs):
        print("!", end="")
    print()

If I could get the bits and pieces I will try to put it together.

Josh21
  • 506
  • 5
  • 15
pwnd16
  • 23
  • 3
  • use button `{}` to correctly format code. – furas Apr 06 '19 at 00:28
  • first use pencil and draw grid on paper and draw hour glass in grid. Now you count empty cells from left to right - because print() put chars from left to right. DO the same with second hour glass which has differen size. Maybe it helps to create code. – furas Apr 06 '19 at 00:35

0 Answers0