It wasn't quite like that, for some time (many months, possibly more than a year) you could use either 0171 or 0207, equally 0181 or 0208 so within London we had to use 11 digit numbers. Then 0181 & 0171 were scrapped and 020 became the London prefix.