Skip to content

Instantly share code, notes, and snippets.

@Goddard
Created April 15, 2019 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goddard/70f32146330a22346d74ec953f5881ab to your computer and use it in GitHub Desktop.
Save Goddard/70f32146330a22346d74ec953f5881ab to your computer and use it in GitHub Desktop.
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