0% found this document useful (0 votes)
10 views1 page

Pattern Program 31

The document contains Python code for generating various patterns based on user input. It includes three patterns: a diamond shape of asterisks, a pyramid of numbers, and a pyramid of sequential numbers. Each pattern is created using nested loops and formatted with spaces for alignment.

Uploaded by

vishnu200121
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)
10 views1 page

Pattern Program 31

The document contains Python code for generating various patterns based on user input. It includes three patterns: a diamond shape of asterisks, a pyramid of numbers, and a pyramid of sequential numbers. Each pattern is created using nested loops and formatted with spaces for alignment.

Uploaded by

vishnu200121
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

9) for q in range(1,num+1-p):

10) print("*",end=" ")


11) print()

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

Pattern-77:
1) num=int(input("Enter a number:"))
2) for i in range(1,num+1):
3) print(" "*(num-i),end="")
4) for j in range(1,i+1):
5) print(i,end=" ")
6) print()
7) for p in range(1,num):
8) print(" "*p,end="")
9) for q in range(1,num+1-p):
10) print(num-p,end=" ")
11) print()

1
22
333
4444
55555
4444
333
22
1

Pattern-78:
1) num=int(input("Enter a number:"))
2) for i in range(1,num+1):
3) print(" "*(num-i),end="")
4) for j in range(1,i+1):
5) print(j,end=" ")
6) print()
7) for p in range(1,num):

nd
DURGASOFT, # 202, 2 Floor, HUDA Maitrivanam, Ameerpet, Hyderabad - 500038,
31  040 – 64 51 27 86, 80 96 96 96 96, 92 46 21 21 43 | [Link]

You might also like