Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can just can try / and if there is an exception, do // instead - like:

try:
    result = x / y
except ZeroDivisionError:
    result = x // y