Python core practice 37.2 "Modules"
Two friends want to play backgammon, but have lost the dice. Create a program to replace the dice. When the program is run, it should roll the dice and output the result of each die. Hint Use random.randint() function to generate random values in the range of 1 to 6 for each dice. You will see a random.seed(int(input())) line in sample code. It initializes the pseudorandom number generator and, in this case, ensures functionality of test cases. My code: import random random.seed(int(input())) #please don't touch this lane #generate the random values for every dice dice1 = random.randint(1, 7) dice2 = random.randint(1, 7) print(dice1) print(dice2) This code fails hidden test 2 The code that you will see below passes all tests. import random random.seed(int(input())) #please don't touch this lane dice1 = random.randint(1, 6) dice2 = random.randint(1, 6) print(dice1) print(dice2) If you write 5 instead of 6, the test will also pass. Someone can tell why this is happening, because "6" should not be accepted. Thanks