title: Find squares of even and odd numbers in the given list
body: <p>I have a list <code>L = [1, 2, 3, 4, 5, 6, 7, 8]</code> and I want to find the squares of all even numbers in <code>L</code> and the squares of all odd numbers in <code>L</code>.</p>
  
  <p>For example, <code>L = [2, 4, 6, 8]</code> should give <code>[4, 16, 36, 64]</code>, and <code>L = [1, 3, 5, 7, 9]</code> should give <code>[1, 9, 25, 49, 81]</code>.</p>
  
  <p>I have tried it like this, but I'm not able to get lists as a result:</p>
  
  <pre><code>num=input("enter the number:")
  # num=[1,2,3,4,5,6,7,8,9]
  if (num%2==0):
      print "The number is even"
      print num*num
  else:
      print "The number is odd"
      print num*num
  </code></pre>