Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

draw a bow tie in python

num = int(input("Enter an odd number greater than 4: "))
center = (num - 1)//2
for row in range(num):
    nspaces = 2*abs(row - center)
    nstars = num - nspaces
    print nstars*'*' + 2*nspaces*' ' + nstars*'*'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #draw #bow #tie #python
ADD COMMENT
Topic
Name
9+2 =