Answer the question
In order to leave comments, you need to log in
How can I make random pick a sequence of three characters, but without repeating?
how to make it randomly give us all possible sequences of numbers 0-9, the entire English alphabet and "_" and not repeat
again, so that randomly gives us all sequences of 3 characters long
example:
s83
_s2
as5
an_
_as2
moi
Answer the question
In order to leave comments, you need to log in
Secondly, the concept of "non-recurring" excludes the concept of "random". By the very fact of tracking the repetition and controlling it, you contribute a share of the order.
In this case, it seems to me, "shuffle", shuffle is applicable.
Take numbers from 0 to 9 and shuffle random.shuffle()
import random
mylist = ["apple", "banana", "cherry"]
random.shuffle(mylist)
print(mylist)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question