Since this happens rarely, it's probably fine to do:

```
try:
    percent = 100.0 * ...
except ZeroDivisionError:
    percent = 0.0
```

Creating a try block is cheap. Handling exceptions is probably more expensive than the key lookup and comparison, but if it doesn't happen often, then it might be cheaper on average.

I think in this case doing a try/except ZeroDivisionError might actually be more understandable.

But either way is fine by me.