Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions task.py
Original file line number Diff line number Diff line change
@@ -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)