Created
April 15, 2019 20:43
-
-
Save Goddard/70f32146330a22346d74ec953f5881ab to your computer and use it in GitHub Desktop.
hankerrank staircase example python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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