Skip to content

Instantly share code, notes, and snippets.

@atul-chaudhary
Created September 4, 2019 04:46
Show Gist options
  • Save atul-chaudhary/bcf9467c56772ad623a17bb914e8de4c to your computer and use it in GitHub Desktop.
Save atul-chaudhary/bcf9467c56772ad623a17bb914e8de4c to your computer and use it in GitHub Desktop.
HOTS: pattern programs
enter the height=3
enter the width=3
enter the number of stairs=3
@@@
@@
@
@@@
@@
@
@@@
@@
@
enter the height=5
enter the width=5
enter the number of stairs=5
@@@@@
@@@@
@@@
@@
@
@@@@@
@@@@
@@@
@@
@
@@@@@
@@@@
@@@
@@
@
@@@@@
@@@@
@@@
@@
@
@@@@@
@@@@
@@@
@@
@
#here is the programs
h=int(input('enter the height='))
w=int(input('enter the width='))
t=int(input('enter the number of stairs='))
s=w*(t-1)
def func(w,s1):
for i in range(w,0,-1):
for _ in range(s1):
print(end=' ')
for j in range(i):
print('@',end='')
print()
for i in range(1,t+1):
func(w,s)
s-=w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment