Loops Hackerrank

 Task

The provided code stub reads and integer, , from STDIN. For all non-negative integers , print .

Example

The list of non-negative integers that are less than  is . Print the square of each number on a separate line.

0
1
4

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

Comments

Popular posts from this blog

XAMPP, SQL BASIC COMMANDS

The Minion Game Hackerrank Solution

Arrays - DS | HackerRank Solutions