Perfect square numbers in python
is this how you reads an integer n and prints out all the positive perfect square
numbers that is not larger than n
n = int(input())
i = 1
result = []
while i * i <= n:
result.append(i * i)
i += 1
print(", ".join(map(str, result)))
Logic
Start from 1
Square
iuntili*i > nPrint all squares ≤
n