Re:In a study of senior CS majors, U.S. students are tops in...
by joshvm on Tuesday March 19, 2019 @02:11PM
(#19433696)
The questions ask for all permutations of length 3. What you've described is the Cartesian product:
import itertools
print(len([x for x in itertools.product(range(10), repeat=3)])) #1000
print(len([x for x in itertools.permutations(range(10), 3)])) #720
itertools.product essentially does a nested for loop.
The reason it's less is because each number has to be different, so you can't have 000 or 111, etc.
The reason it's less is because each number has to be different, so you can't have 000 or 111, etc.