title: How to divide specific elements in a list and then square the values?
body: <p>Given a list of positive integers, you have to find numbers divisible by 3 and replace them with their squares. </p>
  
  <p>For example, consider the list below:</p>
  
  <p>Input: </p>
  
  <pre><code>[1,2,3,4,5,6]
  </code></pre>
  
  <p>The output for the above list would be: </p>
  
  <pre><code>[1,2,9,4,5,36]
  </code></pre>
  
  <p>Here is what I've worked on : </p>
  
  <pre><code>import ast,sys
  input_str = sys.stdin.read()
  input_list = ast.literal_eval(input_str)
  myInt = 3
  new_list = [x / myInt for x in input_list]
  
  def square(input_list)
      if x/3:
          for x in input_list
          return x**2
  
  print (square(input_list))
  </code></pre>