This works almost fine but the number starts with 0 sometimes:
import random
numbers = random.sample(range(10), 4)
print(''.join(map(str, numbers)))
I've found a lot of examples but none of them guarantee that the sequence won't start with 0
.
Aucun commentaire:
Enregistrer un commentaire