How many codes can be formed from three letters (A-Z) followed by two digits ($0$-$9$)? Problem:

A code consists of 3 letters followed by 2 digits. How many codes can we create if a)repetition is allowed b)repetition is not allowed?

Attempt:
The code should looks like this LLLDD (L for letter and D for  digit) so if repetition is allowed, the number of possible codes is
$$(26^3)(10)^2$$
and if repetition is not allowed the number of possible  codes is
$$26 \mathrm{ P }3 \times 10 \mathrm{ P }2.$$
My concern:
How does $(26^3)(10)^2$ or $26 \mathrm{ P }3 \times 10 \mathrm{ P }2$ guarantee that the code has the correct pattern (LLLDD) and not other patterns like LDLDL, LLDDL, it's what permutations do after all (order is important), right?
 A: In both cases, you are counting the number of ways to create LLL and DD separately. Since there is only one way to put them together to create LLLDD, multiply and you're done.
If you wanted to count LDLDL and LLDDL, among other arrangements, you would need to choose the positions of the letters. Or of the numbers. Either way, it's an additional multiplication by ten.
A: Alternative explanation.

how does $(26^3)(10)^2$ or ${}26 \mathrm{ P }3 \times 10 \mathrm{ P }2$ guarantee that the code
has the correct pattern (LLLDD) and not other patterns like LDLDL , LLDDL , it's what permutations do after all (order is important), right?

The formulas do not guarantee the pattern.  However, the formulas are still correct.  The original question is to enumerate the number of ways that the pattern LLLDD can occur.  The formulas are accurate, under the assumption that your attention is confined to the LLLDD pattern.
The fact that the formulas may also be correct for other patterns is totally irrelevant.
