How to choose 10 different integers from range (0, 99)

python

Solution

from random import sample

sample(range(0, 100), 10)

Problem

I want to choose 10 random integers from 0 to 99. I know I can use: ``` random.randint(a, b) ``` But how to tell the randint() that I only want different integers. Do I have to just check after each random generation to see if the integer has already been generated and call the method again? That does not seem like an optimal solution.

Original source