Created
December 6, 2020 12:23
-
-
Save rawinng/ffe9e8186ff1ef867157379b267dfc82 to your computer and use it in GitHub Desktop.
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 main(): | |
n = int(input("Input any number : ")) | |
print_diamond(n) | |
def print_diamond(n): | |
s = str(int('1'*n)**2) | |
print(s) | |
f = '%'+str(n-1)+'s' | |
for i in map(int,s): | |
print(f % s[:i-1]+s[-i:]) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment