title: I'm trying to make a Python procedure that converts binary numbers to decimal numbers
body: <p>I'm trying to create a procedure out of the following code in Python:</p>
  
  <pre><code>print "Program for Binary to Decimal Conversion"
  dec = 0`enter code here`
  bin = 0
  factor = 1;
  print "Enter Binary Number:", 
  bin = input()
  while(bin &gt; 0):
     if( (bin % 10) == 1):
        dec += factor
     bin /= 10
     factor = factor * 2
  print "The Decimal Number is: ", dec
  </code></pre>
  
  <p>It currently runs in the shell asking what the input, I want to make it like a procedure so that it just runs in the python shell without asking anything and the input line would look something like:</p>
  
  <pre><code>procedure(1110101)
  </code></pre>