Python Alphabet Pattern 30

Last Updated:

Python Alphabet Pattern 30

Try to print the following alphabet pattern using Python.

Print This Output
ABCDE
BABCD
CBABC
DCBAB
EDCBA

Source Code

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

Share this Page

Meet the Author