Last active
August 29, 2015 14:10
-
-
Save rob-smallshire/8d807baa643c0e7d5d1a to your computer and use it in GitHub Desktop.
Print a diamond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def d(t):s=ord(t)-65;h=lambda i:'-'*(s-i)+chr(i+65)+'-'*i;m=[h(i)+h(i)[-2::-1] for i in range(s+1)];return'\n'.join(m+m[-2::-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment