We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Introduction
  4. Loops
  5. Discussions

Loops

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

Sort 1415 Discussions, By:

recency

Please Login in order to post a comment

  • palakhil197
    23 hours ago+ 0 comments

    for i in range(n): square = i * i print(square)

    0|
    Permalink
  • a0921089963
    6 days ago+ 0 comments

    num = [] if name == 'main': n = int(input()) i = 0 for a in range(0,n): num.append(i) i += 1 for b in num: if b < n: print(b**2)

    -2|
    Permalink
  • vanhongquan12345
    1 week ago+ 0 comments

    n = int(input()) if n in range(1, 21): for i in range(n): print(pow(i, 2))

    0|
    Permalink
  • abolizagade99
    1 week ago+ 0 comments

    I believe that this approach is not only straightforward but also easy to understand.

    n = int(input()) for i in range(n): i = i ** 2 print(i)

    0|
    Permalink
  • william_odiomon1
    2 weeks ago+ 0 comments

    I thought this would be more simpler

     n = int(input())
     i = 0
        
     while i < n:
            print(i * i)
            i = i + 1
    
    0|
    Permalink
Load more conversations

Need Help?


View tutorial
View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy