Triangle Quest - Python math solution

Triangle Quest - Python math solution

Instructor-svgAl-Mamun Sarkar
Mar 26 , 2020

Triangle Quest - Python math solution. The following shows how to solve the HackerRank Triangle Quest Python Math problem.

Code:

for i in range(1,int(input())): 
    print( ((pow(10, i)-1)//9) * i )

 

Test Input:

5

Test Output:

1
22
333
4444
  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram