Skip to content

Commit

Permalink
Merge pull request #270 from SanskarSh/Sanskar-266
Browse files Browse the repository at this point in the history
Adding code for pattern
  • Loading branch information
Punit-Choudhary authored Oct 31, 2023
2 parents b8ae59c + 2ade053 commit 3a1225b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Patterns/Pyramid_Patterns/Code/Pyramid_Pattern_3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Pyramid Pattern 3

**Pattern Image:**

![image](../../img/pyramidpattern3.PNG)

**Contributor:** [Sanskar Shrivastava](https://github.com/SanskarSh)

:star2: Star it :fork_and_knife:Fork it :handshake: Contribute to it!

Discord server - http://pragmaticprogrammer.in/discord

Happy Coding :purple_heart:
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set the number of rows for the pattern
n = 5

# Loop through rows from 1 to 'n'.
for i in range(1, n + 1):

# Loop to print spaces before the numbers in each row.
for k in range(1, n - i + 1):
print(" ", end=" ")

# Loop to print numbers in ascending order in each row.
for j in range(1, i + 1):
print(j, end=" ")

# Move to the next line to start a new row.
print()

0 comments on commit 3a1225b

Please sign in to comment.