Python Alphabet Pattern 32

Last Updated:

Python Alphabet Pattern 32

Try to print the following alphabet pattern using Python.

Print This Output
    A
   ABA
  ABCBA
 ABCDCBA
ABCDEDCBA

Source Code

Python Compiler
for i in range(65, 70): for j in range(i+1, 70): print(" ", end="") for k in range(65, i+1): a = chr(k) print(a, end="") for m in range(i-1, 64, -1): b = chr(m) print(b, end="") print()

Share this Page

Meet the Author