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.
- Prepare
- Python
- Introduction
- Loops
- Discussions
Loops
Loops
+ 0 comments if name == 'main': n = int(input()) if 1<=n<=20: for i in range (0,n): print(i**2)
+ 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 comments n = int(input()) for i in range(0, n): if i < n: print(i **2)
+ 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)
+ 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);
Load more conversations
Sort 1333 Discussions, By:
Please Login in order to post a comment