Hackerrank Python Triangle Quest Solution

This is the solution for the question at hackerrank, python triangle quest solution. In the question you have to display the output using just a single for loop and a print statement. If used more then 2 lines of code you will not be awarded any score. So here is that simple 2 line of code using which u can solve triangle quest which is a moderate(difficult) level question.

Screenshot/ Outputs

The complete 2 line code

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

If this post helped you, please share it ! 🙂

Bikash Panda
Catch Me On

Bikash Panda

Blogger / Embedded System Developer at WeArGenius
A techie, tinkerer and tech lover, who loves to blog and feels everyone can learn tech provided they have the right attitude towards learning and passion. By profession, I am an IOT developer working in Smart Home/ Smart Grid domain.
Bikash Panda
Catch Me On

Latest posts by Bikash Panda (see all)

Bikash Panda

A techie, tinkerer and tech lover, who loves to blog and feels everyone can learn tech provided they have the right attitude towards learning and passion. By profession, I am an IOT developer working in Smart Home/ Smart Grid domain.