Skip to content

Commit

Permalink
Merge pull request AdarshAddee#254 from SanBuilds/Hourglass_pattern_p…
Browse files Browse the repository at this point in the history
…ython

Create hourglass_pattern.py
  • Loading branch information
AdarshAddee authored Oct 4, 2022
2 parents 960cadc + 67505a6 commit 59e68b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Python/hourglass_pattern.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Github Username - SanBuilds (https://github.com/SanBuilds)
### Hourglass pattern in python

rows = int(input("Enter the rows(height) of the hourglass: "))

for i in range(rows):
for j in range(i):
print('', end = ' ')
for k in range(i,rows):
print('*', end = ' ')
print()

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

0 comments on commit 59e68b5

Please sign in to comment.