Oct-09-2018, 04:48 AM
I am still studying about importing modules, and suddenly I came with an idea of a random number generator which will generate a six-number combination out of numbers within a specified range. I am going to insert a specific portion of my codes
from random import * die1 = randint(1,42) die2 = randint(1,42) die3 = randint(1,42) die4 = randint(1,42) die5 = randint(1,42) die6 = randint(1,42) print("For 6/42: ", die1, "-", die2, "-", die3, "-", die4, "-", die5, "-", die6)I want to make the resulting numbers non-repeating, which means if die1 picked 5, the other variables must not pick 5. That goes for the other variables as well. How will I make it? The book I am using as reference haven't mentioned how to do so.