diff --git a/task.py b/task.py new file mode 100644 index 0000000..61139b1 --- /dev/null +++ b/task.py @@ -0,0 +1,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) +