Created
September 4, 2019 04:46
-
-
Save atul-chaudhary/bcf9467c56772ad623a17bb914e8de4c to your computer and use it in GitHub Desktop.
HOTS: pattern programs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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