Python - Homework - Converting Any Base to Any Base
<p>I'm trying to make a program to convert a number in any base to another base of the user's choice. The code I have so far goes like this:</p>

<pre><code>innitvar = float(raw_input("Please enter a number: "))
basevar = int(raw_input("Please enter the base that your number is in: "))
convertvar = int(raw_input("Please enter the base that you would like to convert to: "))
</code></pre>

<p>These are the data that I get from the user. The innitial number, its innitial base, and the base the user wants to convert to. As I understand it, I need to convert to base 10, and then to the desired base, specified by the user.</p>

<p>This is where I'm hitting a brick wall. I need to multiply the leftmost digit in the initial number by its innitial base, and then add the next digit to the right, and then repeat until I hit the rightmost digit. I understand how to do this on paper, but I have no idea how to put it into Python code. I'm not sure how I would multiply the first number, and then add the next, nor do I understand how to let the program know when to stop performing this operation.</p>

<p>I'm not asking to have the program written for me, but I am asking to be pointed in the right direction.</p>

<p>Thanks for your time</p>
