[go: up one dir, main page]

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

Pattern Program 29

The document provides Python code snippets for generating various patterns based on user input. It includes patterns of asterisks, numbers, and letters, demonstrating nested loops and string manipulation. Each pattern is formatted to display different shapes and sequences based on the input number.

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)
27 views1 page

Pattern Program 29

The document provides Python code snippets for generating various patterns based on user input. It includes patterns of asterisks, numbers, and letters, demonstrating nested loops and string manipulation. Each pattern is formatted to display different shapes and sequences based on the input number.

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
You are on page 1/ 1

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

6) print()

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

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

55555
4444
333
22
1

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

54321
4321
321
21
1
Pattern-73:
1) num=int(input("Enter a number:"))
2) for i in range(1,num+1):
3) print(" "*(i-1),end="")
4) for j in range(1,num+2-i):
5) print(chr(65+num-i),end=" ")
6) print()

nd
DURGASOFT, # 202, 2 Floor, HUDA Maitrivanam, Ameerpet, Hyderabad - 500038,
29  040 – 64 51 27 86, 80 96 96 96 96, 92 46 21 21 43 | www.durgasoft.com

You might also like