Does taking contraceptive pills before and after sex avoid pregnancy?

Can taking contraceptive pills before sex be effective in preventing pregnancy?