Created
February 3, 2020 12:37
-
-
Save housamz/be78d8eb7a2aca909510a7de137bcec6 to your computer and use it in GitHub Desktop.
Python Palindrome
This file contains hidden or 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
input = int(input("Enter your value: ")) | |
final = '' | |
for i in range(1, input + 1): | |
for j in range(input, 0, -1): | |
final += ' ' if (j < i) else str(j) | |
for j in range(2, input + 1): | |
final += ' ' if (j < i) else str(j) | |
final += '\n' | |
print(final) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment