title: python how to generate random numbers based on given input without using random library?
body: <p>Imagine there is a <code>rand8</code> function which returns a random number between [0 - 7]. Now I want to make a function namely as <code>rand11</code> based on the input I get from <code>rand8</code>. like this:</p>
  
  <pre><code> Input from rand8     : 1, 3 , 5  , 7 , 0 , 7 , 2 , 1 , 6 , ...
  Output given by rand11: 0, 5 , 10 , 7 , 6 , 0 , 2 , 9 , 8 , ...
  </code></pre>
  
  <p>So far I found this online:</p>
  
  <pre><code>def lcg(modulus, a, c, seed):
      while True:
          seed = (a * seed + c) % modulus
          yield seed
  
  a = lcg(5, 0, 8, 1)
  next(a)
  </code></pre>
  
  <p>But I am not familiar how to modify function to get numbers between 0 to 7 and return numbers between 0 to 10. Please note that I don't need to implement <code>rand8</code> function. I only have to take care of <code>rand11</code> function? And remember I am not allowed to use <code>random</code> library in python or any other random libraries like <code>numpy.random()</code></p>
  
  <p>Can anyone help me?</p>