Instagram
youtube
Facebook

Loops Hackerrank Solution

Mradul Mishra
Table of Contents

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

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

Example

The list of non-negative integers that are less than n=3  is [0, 1, 2]. 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)

 

Add a comment:

Comments:

Karuvelammal

Ans

Babita soni

I want answer

SANTHAVEL V

I want ans

Ankit Gupta

NA

Raja P

python

Rajendra Prasad

Hi

Soumya Smruti Das

Hii

Sneha

Good

wddfqwef

ewqfqw

Della

Good

asdasd

dshfiad

End

good

K Praveena

Good

Jayabharathi S

No

ax

Sa

Palwai Lokesh

Answers

Palwai Lokesh

Answers

rohan

solution

Tanushri Thamake

What comment

Karthik

Good

Komal

No

Siddiki Akbor

hi

nham

i want know the solution

Karthik

I want solution

Karthik

I want solution

Narisetti prathyusha

Good

neha patel

NICE SOLUTION

Keerthanaa

I want to be a hacker

PAVITHRA BEJAWADA

Ntg