lundi 15 août 2022

How can I print out more than one random result without possible duplicates in any print statements

I am doing a basic random number generator which prints out the fist 6 numbers in a range up to 45 which works fine but I need it to print out a second time with 2 numbers up to 45, these two numbers can not be the same as any of the 6 numbers either.

enter code here
import random

nums = range(1, 45)
supps = range(1,45)

print(random.sample(nums,6))
print(random.sample(supps,2))
enter code here



Aucun commentaire:

Enregistrer un commentaire