Skip to content

Instantly share code, notes, and snippets.

@harry-jung
Created May 17, 2018 03:01
Show Gist options
  • Save harry-jung/e724e9ad93c6346aec5f0076aca4bbfd to your computer and use it in GitHub Desktop.
Save harry-jung/e724e9ad93c6346aec5f0076aca4bbfd to your computer and use it in GitHub Desktop.
피라미드
def printPyramid(num):
matrix = list(map(lambda i: num-abs(i), list(range(num-1, -num, -1))))
for i in matrix:
print(''.join(str(e) for e in matrix[i-1:(len(matrix)-(i-1))]).center(len(matrix), ' '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment