0% found this document useful (0 votes)
5 views2 pages

Pyramid Programs

Uploaded by

palir67298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Pyramid Programs

Uploaded by

palir67298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

rows = int(input("Enter number of rows: "))

for i in range(1, rows+1, 1):


for j in range(1, i+1,1):
print(1, end=" ")
print()
1
22
333
4444
55555

rows = int(input("Enter number of rows: "))


for i in range(1, rows+1, 1):
for j in range(1, i+1,1):
print(j, end=" ")
print()
1
12
123
1234
12345

rows = int(input("Enter number of rows: "))


a = 65
for i in range(rows):
for j in range(i+1):
alphabet = chr(a)
print(alphabet, end=" ")
a+= 1
print()
A
AB
ABC
ABCD

rows = int(input("Enter number of rows: "))


for i in range(rows, 0, -1):
for j in range(0, i):
print("* ", end=" ")
print()
*****
****
***
**
*

rows = int(input("Enter number of rows: "))


for i in range(rows+1, 0, -1):
for j in range(1, i):
print(j, end=" ")
12345
1234
123
12
1

rows = int(input("Enter number of rows: "))


k=0
for i in range(1, rows+1):
for space in range(1, (rows-i)+1):
print(end=" ")

while k!=(2*i-1):
print("* ", end="")
k += 1

k=0
print()

*
* *
* * *
* * * *
* * *
* *
*

You might also like