Triangle Quest 2

  • + 4 comments

    I was sure this would be allowed:

    for i in range(1, int(input())+1):
        print(*(list(range(1, i)) + list(range(i, 0, -1))), sep="")
    

    Turns out specifying the sep parameter with an empty string counts as using strings for your solution. Very annoying.

    Anyways, here is my version:

    for i in range(1, int(input())+1):
        print(sum(map(lambda n: 10**n, range(i)))**2)