I am trying to take a random number from a list that goes from 0 to 9999. When I get that number, I want to compare it to a 4 digit number. Then, if it doesn't work, I want to REMOVE that random number from the list of 0 to 9999 e.g. it picks 9999 randomly and it compares to 3129 so it deletes it from the list and tries again list (range (0000, 9998))
lis = list(range(0000,9999))
import random
num = random.choice(lis)
while int(num) < pin or int(num) > pin:print(num)num = random.choice(lis)count = count + 1lis = lis.remove(num)
print('Got your pin in ' + str(count))
from time import sleep
sleep(4)