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
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterVisible tests
1
Input
-1Expected
False2
Input
0Expected
True3
Input
3Expected
False4
Input
4Expected
True5
Input
25Expected
True6
Input
26Expected
FalseFocus radio
Paused · SomaFM · Fluid