Skip to content

Instantly share code, notes, and snippets.

@angeloped
Created December 2, 2020 06:20
Show Gist options
  • Save angeloped/d9d444bab70a3a090cb46e5b8c088489 to your computer and use it in GitHub Desktop.
Save angeloped/d9d444bab70a3a090cb46e5b8c088489 to your computer and use it in GitHub Desktop.
Determine if the number is perfect square.
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