input: Write a python function to check if a given number is a perfect square.
  assert isPerfectSquare(4)==True
  assert isPerfectSquare(16)==True
  assert isPerfectSquare(18)==False
  assert isPerfectSquare(1)==True
output: def isPerfectSquare(num):
      if num < 0:
          return False
      sqrt = int(num ** 0.5)
      return sqrt * sqrt == num