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
- Discussions
Triangle Quest
Triangle Quest
Sort by
recency
|
1043 Discussions
|
Please Login in order to post a comment
print(10**i//9*i)
Use this ,It will clear the test - First make all the multplier to 1 then multiply it by i.
why isn't this allowed?
for i in range (int(input())-1): print (int(format (2**(i+1)-1,'b'))*(i+1))
edit: ok this is dumb but i think its because of the 'for' in 'format'. Can the dev pls patch this?
if i use the following instead, it works: for i in range (int(input())-1): print (int(bin (2**(i+1)-1)[2:])*(i+1))
For Python3 Platform
for i in range(1,int(input())): #More than 2 lines will result in 0 score. Do not leave a blank line also print(i*sum(list(10**(j) for j in range(i))))
this gives only 1 for is allowed. Even though this solves the problem.