title: How do you create a binary-Decimal conversion program? (format provided)
body: <p>I was accidentally placed in a programming class rather than intro. to computers. Everything is completely over my head. Does anyone know how to do this?</p>
  
  <p>I need to code a <em>decimal binary number conversion program</em> in Python (decimal number to binary and vice versa). The input to the program is a number and a base. The base can only be 2 or 10. If the base is 2, the input is a binary number and the output will be the corresponding decimal number, vice versa.</p>
  
  <p>The program will first ask the user to input the base and then a number in that base. The base can only be “B”, “D” or S. “B”, “D” indicates the input is a binary number or decimal number, respectively and “S” stands for “Stop”. You need to check the validation of the input. </p>
  
  <p>Output Format:</p>
  
  <p>Your output should look as follows:</p>
  
  <pre><code>Please input the base(B:binary, d:deciam, S:Stop)
  B
  please input a number
  1101
  13
  please input the base(b:binary, D:deciam, S:Stop)
  D
  Please input a number
  13
  1101
  Please input the base(B:binary, D:deciam, S:Stop)
  A
  Your input in not a valid base
  Please input the base(B:binary, D:deciam, S:Stop)
  B
  Please input is not a valid binary number
  Please input the base(B:binary, D:deciam, S:Stop)
  S
  </code></pre>