Just curious Dick, why are you making your own to_base method? Doesn't the source I provided in my earlier email give you all that you need? I was hoping my source might be useful to a few people, even though it's pretty trivial code.
<br><br><div><span class="gmail_quote">On 8/12/07, <b class="gmail_sendername">Dick Moores</b> <<a href="mailto:rdm@rcblue.com">rdm@rcblue.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At 07:04 PM 8/12/2007, Michael Bentley wrote:<br><br>>On Aug 12, 2007, at 6:28 PM, Dick Moores wrote:<br>><br>>>n = 12<br>>>base = 36<br>>>print to_base(n, base)<br>>>==========================================
<br>>>This seems to work fine for n >= base, but not for n < base. For<br>>>example, the code shown returns "c". Is my indentation wrong, or<br>>>the code? It seems to me that the code should work for the general
<br>>>case, not just for n >= base.<br>><br>>Isn't 'c' the correct answer?<br><br>Yes, of course. Stupid of me.<br><br>Dick<br><br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">
http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>