티스토리 뷰

Hackerrank/Python

Loops

.   2022. 2. 5. 08:23

[1,20] 범위의 정수 n을 입력 받는다.

0부터 n-1까지 제곱한 값을 각 줄에 출력한다.

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

Loops | HackerRank

 

Loops | HackerRank

Practice using "for" and "while" loops in Python.

www.hackerrank.com

 

'Hackerrank > Python' 카테고리의 다른 글

Print Function  (0) 2022.02.05
Write a function  (0) 2022.02.05
Python: Division  (0) 2022.02.05
Arithmetic Operators  (0) 2022.02.04
Python If-Else  (0) 2022.02.04
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함