# Python Loops Hackerrank Solution

Published November 3, 2023 by Jarvis Silva

In this article, I will share the python loops hackerrank challenge solution. Hackerrank is a popular online platform which has many programming challenges and competitions which allows developers to participate into them and improve their programming skill.

## Question

The provided code stub reads an integer, n, from STDIN. For all non-negative integers i<n , print i2.

You can find the full question of this problem here: Python Loops Hackerrank Challenge Question.

In this challenge we need to use loops to print the square of integers, so to do this program we can use for loop with range function with value of n which is a integer comming from input.

Before moving to the solution you should definately try to do this on your own it is very easy but still if you can’t solve it don’t worry you can check the below solution and understand this program.

## Python Loops Hackerrank Solution

``````
if __name__ == '__main__':
n = int(input())
for i in range(n):
print(i*i)
```
```

Above is the python code for loops Hackerrank challenge, you can submit the above code in hackerrank and it should show you congratulations you solved this challenge.

So this was for this article, I hope you found what you were looking and if you want more hackerrank solutions then visit here: Hackerrank python solutions.

Thank you for reading, Happy coding 😊