I am supposed to print a random 5-digit number with no repeating digits, then ask the user for a three digit number. If the user\'s number contains three digits from the ran
You can generate all the 5 digits ints with unique digits like so:
tgt=set() for i in range(1234,99999+1): s='{:05d}'.format(i) if len(set(s))==5: tgt.add(s)
Then use random.choose(tgt) to select one at random.
random.choose(tgt)
(but tdelaney's answer is better)