There are 10 numbers from 0 to 9 which may be used for the 3-digit code. To answer the questions above, make use of the Fundamental Principles of Counting.
a. There are 10 digits that may be used in all of the 3 places of the code:
10 x 10 x 10 = 1000
b. Since repetition is not allowed. On the first place of the code, 10 digits are allowed. After using any of the digits, only 9 are available for the second digit and 8 on the third.
10 x 9 x 8 = 720
Thus, there are 1000 and 720 possible 3-digit codes in cases a and b, respectively.