OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

range() with x Base (not base 10) [closed]

  • Thread starter Thread starter user2122589
  • Start date Start date
U

user2122589

Guest
I want to have a range() function that works in different bases (namely base 4).

I could do the following if the amount of digits are known:

Code:
for a in range(4):
    for b in range(4):
        print str(a) + str(b)

However the amount of digits needed to be generated is unknown. I'm thinking I will need recursion of some kind.
<p>I want to have a range() function that works in different bases (namely base 4).</p>

<p>I could do the following if the amount of digits are known:</p>

<pre><code>for a in range(4):
for b in range(4):
print str(a) + str(b)
</code></pre>

<p>However the amount of digits needed to be generated is unknown. I'm thinking I will need recursion of some kind. </p>
 
Top