In this python program, we will learn how to print the inverted right-angled triangle star pattern.
Here is the source code of the program to print the inverted right-angled triangle star pattern.
# Python Program to Print the Inverted Right Triangle
# Star Pattern Using While and For Loop
# Take the Input from the User
rows = int(input("Enter the total Number of Rows: "))
# Print the Output
print("Inverted Right Triangle Star Pattern")
i = rows
while(i >= 1):
for j in range(1, i + 1):
print('*', end = ' ')
i = i - 1
print()
Enter the total Number of Rows: 5
Inverted Right Triangle Star Pattern
* * * * *
* * * *
* * *
* *
*
# Python Program to Print the Inverted Right Triangle
# Star Pattern Using While Loop
# Take the Input from the User
rows = int(input("Enter the total Number of Rows: "))
# Print the Output
print("Inverted Right Triangle Star Pattern")
i = rows
while(i >= 1):
j = 1
while(j <= i):
print('*', end = ' ')
j = j + 1
i = i - 1
print()
Enter the total Number of Rows: 6
Inverted Right Triangle Star Pattern
* * * * * *
* * * * *
* * * *
* * *
* *
*
Comments