title: Python Program on Perfect Squares
body: <p>I wrote this python function which takes a list as a parameter and determines which elements of the list are perfect squares and then returns a new list of just those select elements. </p>
  
  <p>Here is my function: </p>
  
  <pre><code>def square(n):
      return n**2
  
  def perfectSquares1(L):
      import math
      m=max(L)
      for n in L:
          if type(n) is int and n&gt;0:
              Result=map(square,range(1,math.floor(math.sqrt(m))))
              L1=list(Result)
      L2=list(set(L).intersection(set(L1)))
      return L2
  </code></pre>
  
  <p>But now I'm trying to re-work it a little: I want to write a one-line Boolean function that takes n as a parameter and returns True if n is a perfect square and returns false otherwise.</p>
  
  <p>Any advice? I can't figure out a way to make it only one line. </p>