-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsandclock.py
More file actions
27 lines (27 loc) · 781 Bytes
/
Copy pathsandclock.py
File metadata and controls
27 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Python script to print sans clock
def SandClock(height):
try:
if height%2==0:
raise Exception(ValueError)
row=height//2+1
for i in range(row):
for j in range(row):
if i>j:
print(end=" ")
else:
print("*",end=" ")
print()
for i in range(1,row):
for j in range(row):
if i+j<row-1:
print(end=" ")
else:
print("*",end=" ")
print()
except ValueError:
print("The height value should be only even")
except:
print("There is an issue in your input")
finally:
print("The End")
SandClock(9)