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 1333 Discussions, By:

recency

Please Login in order to post a comment

  • sathyanarayana75
    1 day ago+ 0 comments

    if name == 'main': n = int(input()) if 1<=n<=20: for i in range (0,n): print(i**2)

    0|
    Permalink
  • nhattan02052003
    2 days ago+ 0 comments

    if name == 'main': n = int(input())

    def pow1(n): if 1<= n <= 20: for i in range(0, n): if i < n : po = pow(i,2) print(po) else: n = int(input())

    pow1(n)

    0|
    Permalink
  • adamsmustapha419
    4 days ago+ 0 comments
        n = int(input())
    
    for i in range(0, n):
        if i < n:
            print(i **2)
    
    -5|
    Permalink
  • sydias
    7 days ago+ 0 comments

    Crazy way of doing it,

    if __name__ == '__main__':
        n = int(input())
        a = []
    
        while(n > 0):
            n = n - 1
            a.append(n * n)
    
        a.reverse()
        
        for x in a:
            print(x)
    
    0|
    Permalink
  • venkataseshagiri
    1 week ago+ 1 comment

    This is my code can some one pls help me when have i gone wrong n=int(input()) for n in range(1,n): print(n*n);

    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