Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check if a number is a perfect square python

import math

def is_perfect_square(number: int) -> bool:
    """
    Returns True if the provided number is a
    perfect square (and False otherwise).
    """
    return math.isqrt(number) ** 2 == number
Source by kodify.net #
 
PREVIOUS NEXT
Tagged: #check #number #perfect #square #python
ADD COMMENT
Topic
Name
7+7 =