Triangle Quest

  • + 0 comments

    I didn't figure out the math but found a way of using the walruss operator:

    for i in range(1,int(input())):
        print( i * (prev := (1 if i == 1 else prev + pow(10, i - 1) ) ) )