Generate random numbers in range from INPUT (python)
<p>This is a question close to some others I have found but they don't help me so I'm asking specifically for me and my purpose this time. </p>

<p>I'm coding for a bot which is supposed to ask the user for max and min in a range, then generating ten random numbers within that range. When validating I'm told both <code>random</code> and <code>i</code>are unused variables. I don't really get why. I believed <code>random.radint</code>was supposed to be a built in function and as far as <code>i</code> is concerned I really don't know what to believe. This is what I've got so far. </p>

<pre><code>def RandomNumbers():
    """
    Asking the user for a min and max, then printing ten random numbers between min and max.
    """
    print("Give me two numbers, a min and a max")
    a = input("Select min. ")
    b = input("Select max. ")


    for i in range(10):
        number = random.randint(a, b)
    print(str(number)+ str(","), end="")
</code></pre>

<p>I'll be very happy for every piece of advice I can get to complete my task. Thank you in advance!</p>

<p>A couple of points worth mentioning with your original function:</p>

<ul>
<li>the <code>random</code> module is not built-in, you have to explicitly import it.</li>
<li><code>input</code> always returns strings, so you have to convert them to integers, before passing them to <code>random.randint</code></li>
<li><code>i</code> is indeed not use within your for loop. You may as well replace it with <code>_</code> (reinforcing the fact, that you loop because of side-effects, e.g. printing and not the variable itself).</li>
<li>More of a stylistic side-note regarding function names: PEP8 (Python style guide) encourages the use of lowercase in combination with underscore to separate words and not camel case (<code>random_number</code>vs <code>RandomNumber</code>)</li>
</ul>

<p>Here's a working example:</p>

<pre><code>import random 

def random_numbers():
    """
    Asking the user for a min and max, then printing ten random numbers between min and max.
    """
    print("Give me two numbers, a min and a max")
    a = int(input("Select min. "))
    b = int(input("Select max. "))

    numbers = [random.randint(a, b) for i in range(10)]
    print(','.join(str(n) for n in numbers))

random_numbers()
</code></pre>

python