To creat a 4 - digit code, we need to consider that for each digit we have 10 options:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -----> 10 options for each digit.
Next, we multiply the number of options we have for each digit. In this case, since we need the code to have 4 digits:

We multiply 4 times 10.
And the result is:

He has 10,000 ways to create a 4-digit code.