Skip to content

Instantly share code, notes, and snippets.

View chrishoffman's full-sized avatar

Chris Hoffman chrishoffman

  • Pennsylvaina, USA
View GitHub Profile
@chrishoffman
chrishoffman / diamonds.py
Last active December 16, 2015 15:09
Diamonds and stars
def draw_line(number_of_stars, width):
spaces = (width - number_of_stars) / 2
print ' ' * spaces + '*' * number_of_stars
def diamond(number):
for i in xrange(1, number, 2):
draw_line(i, number)
for i in xrange(number, 0, -2):
draw_line(i, number)