[Solved] Any idea why hackerrank doesn’t accept my code even if it prints exactly what is asked


You have an extra line of spaces on the top
Try this-

import math
import os
import random
import re
import sys

# Complete the staircase function below.
def staircase(n):
    for x in range(1,n+1):
        print((n-x)*" "+"#"*x)

if __name__ == '__main__':
    n = int(input())

    staircase(n)

solved Any idea why hackerrank doesn’t accept my code even if it prints exactly what is asked