0
1 or i?
Why Not "import random for i in range(5): value = random.randint(i, 6) print(value)" Instead of "import random for i in range(5): value = random.randint(1, 6) print(value)" ?
1 Answer
+ 3
The two codes will output different values. The first prints 5 random values within a different range each time: 0 to 6, 1 to 6, 2 to 6, 3 to 6, and 4 to 6. The second prints 5 random values within the same range: 1 to 6. Therefore, the first would tend to have higher numbers than the second.