Created
December 2, 2020 06:20
-
-
Save angeloped/d9d444bab70a3a090cb46e5b8c088489 to your computer and use it in GitHub Desktop.
Determine if the number is perfect square.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_square(n): | |
return (n**(1.0/2))%1==0 | |
print(is_square(25)) | |
print(is_square(24)) | |
print(is_square(8)) | |
print(is_square(2)) | |
print(is_square(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment