muhammad_nasif

TASK_08

Apr 15th, 2021 (edited)
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. def show_palindrome(value):
  2.     result = []
  3.     limit = value
  4.     limit /= 2
  5.     limit = int(limit)
  6.     for i in range(1, value + 1):
  7.         result.append(i)
  8.     for i in range(value - 1, 0, -1):
  9.         result.append(i)
  10.     return result
  11.  
  12.  
  13. def show_palindromic_triangle(num):
  14.     counter = 1
  15.     for i in range(0, num):
  16.         for i in range(0, num - counter):
  17.             print(" ", end=" ")
  18.         result = show_palindrome(counter)
  19.         for i in result:
  20.             print(i, end=" ")
  21.         counter += 1
  22.         print()
  23.  
  24.  
  25. value = input()
  26. value = int(value)
  27. show_palindromic_triangle(value)
Add Comment
Please, Sign In to add comment