Skip to content
Home » Python Programs » Inverted Alphabet Triangle Pattern Program in Python

Inverted Alphabet Triangle Pattern Program in Python

Simple inverted alphabet triangle pattern program in python. In this program, we can execute the triangle pattern using python for beginners.

For Loop Definition in Python

In Python, a for loop is a control flow statement that is used to execute a set of statements repeatedly as long as the condition is met. An iterative statement is another name for this type of statement. A for loop is thus an iterative statement.

Range in For Loop

In Python, the range() function generates an immutable sequence of numbers that begins with the start integer and ends with the finish integer. In Python, we can use a for loop with range to repeat an activity a set number of times (). 

Python has a built-in function called range(). It returns a number sequence that starts at zero and increments by one by default, stopping before the provided number.

Inverted Alphabet Triangle Pattern Program in Python

rows = int(input("Enter the number"))
alphabet = 64
for i in range(0, rows):
    for j in range(rows - 1, i - 1, -1):
        print('%c' %(alphabet + j), end = ' ')
    print()

Enter the number4
C B A @
C B A
C B
C