forked from Programming-Club-IAU/Level-1.1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.py
More file actions
27 lines (18 loc) · 639 Bytes
/
task.py
File metadata and controls
27 lines (18 loc) · 639 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
def print_staircase(size):
for i in range(1, size + 1):
print(' ' * (size - i), end='')
# Print staircase
print('*' * i)
def print_double_staircase(size):
for i in range(1, size + 1):
# Print leading spaces
print(' ' * (size - i), end='')
# Print left side of the staircase
print('*' * i, end=' ')
# Print right side of the staircase
print('*' * i)
size = int(input("Enter the size of the staircase: "))
print("Single-sided staircase:")
print_staircase(size)
print("\nDouble-sided staircase:")
print_double_staircase(size)