Of course the second one:
A = 1
B = some_other_value
if B != 0:
A /= B
Not because it's more readable but because you're not using exceptions for a non exceptional condition. If an invalid input or an input that may cause an error is possible in normal circumstances then you should never use exception to handle it.
You can find very good explanations about this around the web but in my opinion (beside performance) is always because of intent: when you handle an exception then you make clear to readers that it's an exceptional condition, an error, something that should not happen in normal program flow. In your case it's not because an invalid input is absolutely possible (every single input must be validated, always).
From my point of view the fact that you want to handle it means that's it's possible then a check is always the right solution. Like Ryan said, you may have higher polymorphism if you don't have to check for zero, then what you have to do is to move the check where you can handle the situation (in the / operator for example and not where you use it).
EDIT
Few words more to summarize what I wrote as comments. Python encourage a programming style called EAFP, this is a great resource when you write small scripts but it should be used carefully when you write applications and libraries.
It helps to keep code short (and quick for the most common code path) but it has a big disadvantage: if you don't wrap in try
/execpt
each couple of lines you'll have to handle intermediate results and partials computations. A big try
may leave application in an undeterminate state (or it'll just make your code much less readable because a long list of - possibly nested - try
/except
/else
/finally
).
I agree it helps to use your code in situations you didn't even think about but this is not flexibility, it's fragility. It may be OK for a short personal script but if I write an application (or, even more, a library) I want to be sure where and how my code will fail, I'll write tests to check how it works with different inputs. I don't want it'll fail in ways I can't predict, unexpected input > unexpected behavior sounds too much like garbage input > garbage output. Application must be robust. After you checked everything you can check then you even have to be ready for exceptional situations (I may relax this rule for so rare situations that checking may be paranoic).