Skip to content

Instantly share code, notes, and snippets.

@Goddard Goddard/staircase.py
Created Apr 15, 2019

Embed
What would you like to do?
hankerrank staircase example python
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the staircase function below.
def staircase(n):
for i in range(n):
print_value = ""
for j in range(n):
if(j >= n-i-1):
print_value += "#"
else:
print_value += " "
print(print_value)
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
You can’t perform that action at this time.