title: Python printing binary value and its decimal form
body: <p>Python 2.6/2.7</p>
  
  <p>I have the following program.</p>
  
  <pre><code>print 0b10
  
  def p_m(x):
      print x
  
  p_m(bin(2))
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>2
  0b10
  </code></pre>
  
  <p>What I wanted to print in p_m() is 2 (the decimal value) of "0b10" which is what I'm passing to p_m() as first argument and getting this value "0b10" in variable x and just printing that x. </p>
  
  <p>Why <code>print x</code> inside the function is NOT working like the first line in the program?</p>
  
  <p>What should I do in p_m()'s print statement to print the value of "<em>0b10</em>" as <strong>2</strong>.</p>