An n digit number cannot have its first digit 0,
So the first digit can be chosen in 9 ways,
the second digit can be 0, but not the same as the first one, so it can be chosen in 9 ways,
The third digit may be 0if the second is not 0, but not same as the second, even this can be chosen chosen in 9 ways, the same follows for any number of numbers.
So each digit can be chosen in 9 ways
Hence n digits can be chosen in 9n ways!!