Skip to content

Commit 4ccfe99

Browse files
authored
Update Mario-More.py
1 parent c28742f commit 4ccfe99

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

Mario-Less-More/Mario-More.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
# github : alisharify
2-
#implementation of Mario-More problem set in python
31
print("Height Must between 1 to 8")
42

5-
#check if user input is not a number
63
try:
7-
#Get input From user
84
x = int(input("Enter Height: "))
95
except ValueError:
106
print(f"-{x}- is Not a Number!")
117
exit()
128

13-
#Safety check for get correct Number
149
if (x <= 0 or x > 8):
1510
print(f"-{x}- is Out of Range!")
1611
exit()
1712

18-
#With this for loop we Iterate each line code
1913
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
2214
x -= 1
23-
#This for loop for print space
2415
print(" " * x, end ="")
25-
#this for loop for print hash
2616
print("#" * i, end ="")
27-
#for print space between mario block
2817
print(" ", end="")
29-
#And this for loop for print right block
30-
print("#" * i)
18+
print("#" * i)

0 commit comments

Comments
 (0)