Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created September 16, 2023 06:22
Show Gist options
  • Save codeperfectplus/02b5ac5a02e481c604aa845bdd6700ab to your computer and use it in GitHub Desktop.
Save codeperfectplus/02b5ac5a02e481c604aa845bdd6700ab to your computer and use it in GitHub Desktop.
'''
Topic : Algorithms
Subtopic : StairCase
Language : Python
Problem Statement : Write a program that prints a staircase of size 'n'.
Url : https://www.hackerrank.com/challenges/staircase/problem
'''
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the staircase function below.
def staircase(n):
for i in range(1, n + 1):
print(f'{"#"*i:>{n}}')
if __name__ == '__main__':
n = int(input())
staircase(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment