Triangle Quest

Sort by

recency

|

1043 Discussions

|

  • + 0 comments

    print(10**i//9*i)

    Use this ,It will clear the test - First make all the multplier to 1 then multiply it by i.

  • + 0 comments

    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))

  • + 0 comments
    for i in range(1,int(input())):
        print(sum(map(lambda x: i * 10 ** x,range(i))))
    
  • + 0 comments

    For Python3 Platform

    for i in range(1,int(input())):
        print(i * (10**i)//9)
    
  • + 0 comments

    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.