0% found this document useful (0 votes)
7 views21 pages

Pattern Printing Techniques in Python

The document provides a series of programming tasks focused on printing patterns using stars (*) and numbers based on a given integer N. Each task includes sample input and expected output for various shapes such as triangles, squares, and diamonds. The tasks range from simple horizontal prints to more complex patterns involving combinations of stars and numbers.

Uploaded by

naveenkumar
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)
7 views21 pages

Pattern Printing Techniques in Python

The document provides a series of programming tasks focused on printing patterns using stars (*) and numbers based on a given integer N. Each task includes sample input and expected output for various shapes such as triangles, squares, and diamonds. The tasks range from simple horizontal prints to more complex patterns involving combinations of stars and numbers.

Uploaded by

naveenkumar
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

Q1.

Printing * horizontally

Sample Input: Sample Output:

N=4 ****
Q2. Printing numbers from 1 to N

Sample Input: Sample Output:

N=4 1234
Q3. Printing numbers from 1 to N with comma

Sample Input: Sample Output:

N=4 1,2,3,4
Q4. Printing * with #

Sample Input: Sample Output:

N=8 ***#***#**
M=3
Q5. Printing * in 2 – D

Sample Input: Sample Output:


**
N=4 **
M=2 **
**
Q6. Printing N lines of stars in Square fashion

Sample Input: Sample Output:


****
****
N=4 ****
****
Q7. Printing stars in right angle triangle

Sample Input: Sample Output:


*
**
N=4 ***
****
Q8. Printing numbers in right angle triangle

Sample Input: Sample Output:


1
N=4 12
123
1234
Q9. Printing increment numbers in right angle triangle

Sample Input: Sample Output:


1
23
N=4
456
7 8 9 10
Q10. Printing * and # in right angle triangle

Sample Input: Sample Output:


#
N=4 #*
#*#
#*#*
Q11. Printing numbers in inverted right angle triangle

Sample Input: Sample Output:


N=4 1234
123
12
1
Q12. Printing stars in pyramid

Sample Input: Sample Output:


*
**
N=4 ***
****
Q13. Printing stars in inverse pyramid

Sample Input: Sample Output:


****
N=4 ***
**
*
Q14. Printing stars in diamond fashion

Sample Input: Sample Output:


*
**
N=4 ***
****
****
***
**
*
Q15. Printing stars in mirrored right triangle

Sample Input: Sample Output:

N=4 *
**
***
****
Q16. Printing stars in Inverse Half Diamond Pattern

Sample Input: Sample Output:


N=4 *******
*****
***
*
Q17. Printing stars in Diamond pattern

Sample Input: Sample Output:


N=4 *
***
*****
*******
*****
***
*
Q18. Diamond pattern – Nos. and Stars

Sample Input: Sample Output:


N=4
1
2*2
3*3*3
4*4*4*4
3*3*3
2*2
1
Q19. Triangle pattern – Nos. and Stars
Sample Input: Sample Output:
N=4 1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
Q20. Printing custom number pattern

Sample Input: Sample Output:


N=4 1112
3222
3334
5444
THANK YOU

You might also like