Files
004_comission/ttng1234/Q2/step4.py
louiscklaw 49e275d85d update,
2025-01-31 20:12:48 +08:00

25 lines
519 B
Python

#!/usr/bin/env python
test_list = [ 21,9,17,10 ]
def square_number_sequence(test_number):
# Initialize the sequence with the first number
sequence = [1]
# Generate the Square sequence
keep_find = True
i = 2
while keep_find:
next_num = i * i
keep_find = next_num < test_number
i = i + 1
return next_num == test_number
def check_mathematical_series(n: int) -> str:
print(square_number_sequence(n))
for n in test_list:
check_mathematical_series(n)