File tree 1 file changed +1
-13
lines changed
1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 1
- # github : alisharify
2
- #implementation of Mario-More problem set in python
3
1
print ("Height Must between 1 to 8" )
4
2
5
- #check if user input is not a number
6
3
try :
7
- #Get input From user
8
4
x = int (input ("Enter Height: " ))
9
5
except ValueError :
10
6
print (f"-{ x } - is Not a Number!" )
11
7
exit ()
12
8
13
- #Safety check for get correct Number
14
9
if (x <= 0 or x > 8 ):
15
10
print (f"-{ x } - is Out of Range!" )
16
11
exit ()
17
12
18
- #With this for loop we Iterate each line code
19
13
for i in range (1 ,(x + 1 )):
20
- # we in each Iterate -1 from X For space
21
- # if we get 5 in first Line we should print 4 space and one hash
22
14
x -= 1
23
- #This for loop for print space
24
15
print (" " * x , end = "" )
25
- #this for loop for print hash
26
16
print ("#" * i , end = "" )
27
- #for print space between mario block
28
17
print (" " , end = "" )
29
- #And this for loop for print right block
30
- print ("#" * i )
18
+ print ("#" * i )
You can’t perform that action at this time.
0 commit comments