Triangle Quest 2

  • + 1 comment

    for i in range(1, n + 1): print(int("1" * i) ** 2)

    why is this showing an error as invalid string literal.

    My thought is simple as increasing the number of 1 each time loop increases and then printing the square as this series repeats as a square of increasing 1,11,111,1111