Loops | HackerRank
Practice using "for" and "while" loops in Python.
www.hackerrank.com
Goal
Read integer value n, and print i² for all non-negative integer i < n.
Solution
If you know for statement in python, it woul be very easy task.
# Loops
if __name__ == '__main__':
n = int(input())
for i in range(n):
print(i * i)
'software Engineering > (Python)HackerRank' 카테고리의 다른 글
[Python] HackerRank - Print Function (0) | 2023.01.27 |
---|---|
[Python] HackerRank - Write a function (0) | 2023.01.26 |
[Python] HackerRank - Python: Division (0) | 2023.01.20 |
[Python] HackerRank - Arithmetic Operators (0) | 2023.01.19 |
[Python] HackerRank - Python If-Else (0) | 2023.01.19 |