title: Integer to base-x system using recursion in python
body: <p>I am trying to write a recursive code that can convert a number to any base system. for example, the integer 10 into binary would convert to 1010</p>
  
  <p>So far I have this but I'm having "None" in between my output. Can anyone help me with my code?</p>
  
  <pre><code>def convert(a,b):
      add = a%b
      if a&lt;=1:
          return a
      else:
          print(base(a//b,b), add)
  </code></pre>
  
  <p>my idea is that a%b is the number to add to the end of the number and a//b is the recursive part where it uses the answer of the previous binary number so 10 in base 2 is just convert(5,2) and add the 0 at the end since a//b=5 and a%b=0 which = 1010</p>