If the range is not very large, you can create a Boolean array, called for example "available", initialized to true, which will indicate which numbers of the range are available, and a variable "available" with the number of random numbers that we have available, initialized in available.length, then choose a random number between 1 and "available", and scroll "available" looking for the position "true" number "random", the position will be the answer, we assign "false" in the "random" position and decrease "available".
In this way, skipping the available "false" will only come out once.
Sorry it does not show python code, but I do not know it.
Example in javascript:
<!DOCTYPE html>
<button onclick="aleatorio()">Mostrar numero aleatorio</button>
<button onclick="resetear()">Resetear rango</button>
<SCRIPT>
var rango=11; // de 0 a 10;
var disponible=[];
var disponibles;
function resetear(){
for (var i=0; i<rango; i++) disponible[i]=true;
disponibles=rango;
}
function aleatorio(){
if (!disponibles) {document.body.innerHTML+="Fin "; return;}
var azar=Math.floor(Math.random()*disponibles)+1;
var contador=0, posicion=0;
while (contador<azar) if (disponible[posicion++]) contador++;
disponible[--posicion]=false;
disponibles--;
document.body.innerHTML+=posicion+" ";
}
resetear();
</SCRIPT>