Perfect Square Check
A perfect square is a number you can get by multiplying an integer by itself. Write is_square, which checks the number n and returns True if it is the square of an integer. 0 counts as a square, but negative numbers do not.
Примеры
Ввод
-1Вывод
FalseВвод
0Вывод
TrueВвод
3Вывод
FalseНужно реализовать
def is_square(n: int) -> bool:
Теги
math
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
-1Expected
False2
Input
0Expected
True3
Input
3Expected
False4
Input
4Expected
True5
Input
25Expected
True6
Input
26Expected
FalseFocus radio
Paused · SomaFM · Fluid