filmov
tv
Print Inverted half pyramid pattern of numbers using Python | Printing Patterns in Python - 03
Показать описание
Print Inverted half pyramid pattern of numbers using Python | Printing Patterns in Python - 03
How to print pattern in Python?
Learn Pattern Programs in Python
Pattern Program in Python
reverse number pattern in python
number pattern in python
pyramid pattern in python using for loop
Example:
"""
Inverted half-pyramid pattern of numbers using Python
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5
"""
rows = int(input(":: Enter numbers :: "))
x = 0
# outer loop - reverse for loop from rows to 0
for i in range(rows, 0 ,-1):
x +=1
# inner loop
for j in range(1,i+1):
# print pattern
print(x, end=" ")
print("\r")
How to print pattern in Python?
Learn Pattern Programs in Python
Pattern Program in Python
reverse number pattern in python
number pattern in python
pyramid pattern in python using for loop
Example:
"""
Inverted half-pyramid pattern of numbers using Python
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5
"""
rows = int(input(":: Enter numbers :: "))
x = 0
# outer loop - reverse for loop from rows to 0
for i in range(rows, 0 ,-1):
x +=1
# inner loop
for j in range(1,i+1):
# print pattern
print(x, end=" ")
print("\r")