Triangle Quest 2

Sort by

recency

|

1174 Discussions

|

  • + 0 comments

    n = int(input()) pyramid = []

    for i in range(1, n + 1): # build ascending and descending numbers line = list(range(1, i + 1)) + list(range(i - 1, 0, -1)) pyramid.append(''.join(map(str, line))) # we convert numbers to strings here once

    single print statement

    print(*pyramid, sep='\n')

  • + 0 comments

    n = int(input()) pyramid = []

    for i in range(1, n + 1): # build ascending and descending numbers line = list(range(1, i + 1)) + list(range(i - 1, 0, -1)) pyramid.append(''.join(map(str, line))) # we convert numbers to strings here once

    single print statement

    print(*pyramid, sep='\n')

  • + 0 comments

    For Python3 Platform

    for i in range(1,int(input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also
        print(pow(10**i//9, 2))
    
  • + 0 comments

    n = int(input()) for i in range(1, n+1): print((10**i // 9)**2)

  • + 0 comments

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