We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Math
- Triangle Quest 2
- Discussions
Triangle Quest 2
Triangle Quest 2
Sort by
recency
|
1071 Discussions
|
Please Login in order to post a comment
or i in range(1, int(input())+1): print(((10**i - 1) // 9) ** 2)
So doing it numerically is probably the intended solution, but this worked...
print(*(list(range(1, i+1)) + list(range(i - 1, 0, -1))), sep=__name__[:0])
for i in range(1, int(input()) + 1): print(((10 ** i - 1) // 9) ** 2)
Hello,
Here's a hint:
1 * 1 = 1
11 * 11 = 121
111 * 111 = 12321
...
Hope this helps, here's my code: