Python Alphabet Pattern 21

Last Updated:

Python Alphabet Pattern 21

Try to print the following alphabet pattern using Python.

Print This Output
A
B*B
C*C*C
D*D*D*D
E*E*E*E*E
D*D*D*D
C*C*C
B*B
A

Source Code

Python Compiler
for i in range(65, 70): count = 1 for j in range(64, i): a = chr(i) if(count == 1): print(a, end="") count = 2 else: print("*"+a, end="") print() for i in range(68, 64, -1): count = 1 for j in range(64, i): if(count == 1): a = chr(i) print(a, end="") count = 2 else: print("*"+a, end="") print()

Share this Page

Meet the Author