Skip to content

Instantly share code, notes, and snippets.

@copperlight
Created April 28, 2016 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save copperlight/7fb0a5ec34e026368679a0bfcb2566b9 to your computer and use it in GitHub Desktop.
Save copperlight/7fb0a5ec34e026368679a0bfcb2566b9 to your computer and use it in GitHub Desktop.
def diamond(width, offset):
for w in (range(1, width) + range(width, 0, -1))[::2]:
print " " * offset,
print " " * int((width - w) / 2),
print "x" * w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment