Python Program to Print Repeated Character Pattern

Write a Python program to print repeated character pattern or alphabets pattern in each row using for loop.

rows = int(input("Enter Repeated Characters in each Row Pattern Rows = "))

print("====Repeated Characters/Alphabets in each Row Pattern====")

alphabet = 65

for i in range(0, rows):   
    for j in range(0, i + 1):
        print('%c' %alphabet, end = ' ')
    alphabet = alphabet + 1
    print()
Python Program to Print Repeated Character in each Row

This Python example displays the right triangle pattern of repeated characters in each row pattern using a while loop.

rows = int(input("Enter Repeated Characters in each Row Pattern Rows = "))

print("====Repeated Characters/Alphabets in each Row Pattern====")

alphabet = 65
i = 0

while(i < rows):
    j = 0
    while(j <=  i):
        print('%c' %alphabet, end = ' ')
        j = j + 1
    alphabet = alphabet + 1
    print()
    i = i + 1
Enter Repeated Characters in each Row Pattern Rows = 12
====Repeated Characters/Alphabets in each Row Pattern====
A 
B B 
C C C 
D D D D 
E E E E E 
F F F F F F 
G G G G G G G 
H H H H H H H H 
I I I I I I I I I 
J J J J J J J J J J 
K K K K K K K K K K K 
L L L L L L L L L L L L 

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.